Skip to content

multilineAmbiguities

Reports ambiguous multiline expressions that could be misinterpreted.

✅ This rule is included in the ts stylistic and stylisticStrict presets.

When a line ends with an expression and the next line starts with certain characters (parentheses, brackets, or template literals), JavaScript may interpret them as a continuation of the previous line rather than separate statements. This can lead to unexpected behavior and runtime errors that are difficult to debug.

const
const value: any
value
=
const identifier: any
identifier
(
const expression: any
expression
)
const doSomething: any
doSomething
();
const
const data: any
data
=
const getArray: any
getArray
[0].
any
value
;
const
const result: any
result
=
const calculate: any
calculate
`template literal`;
function
function process(): void
process
() {
const
const a: any
a
=
const b: any
b
(
const c: any
c
||
const d: any
d
).
any
execute
();
}

This rule is not configurable.

If you consistently use semicolons and have tooling that enforces their presence, this rule may be unnecessary. However, having this rule enabled provides an additional safety net against accidental multiline ambiguities.

Made with ❤️‍🔥 around the world by the Flint team and contributors.