Unexpected newline between function and ( of function call.
2708 // which bidi section the coordinates fall into.
2709 if (order) {
2710 const part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)
2711 (cm, lineObj, lineNo, preparedMeasure, order, x, y)2712 ltr = part.level != 1
2713 // The awkward -1 offsets are needed because findFirst (called
2714 // on these below) will treat its first bound as inclusive,
Description
It is recommended to use a multiline expression with proper use of newlines; otherwise, it can cause confusion and have a different outcome than what the developer intended.
Consider the following code-snippet:
someFuncCall()
[2].concat([3])
The two lines are being interpreted as one expression i.e
someFuncCall()[2].concat([3])
This might even throw a runtime error if someFuncCall()
does not return a multi-dimensional array.
Bad Practice
const upperLimit = limit
(1 || 2).get();
const hello = 'world'
[1, 2, 3].forEach(addNumber);
const x = function() {}
`hello`
const y = function() {}
y
`hello`
const z = upperLimit
/regex/g.test(limit)
Recommended
const upperLimit = limit;
(1 || 2).get();
// Two different expression separated using semi-colon
const upperLimit = limit
;(1 || 2).get()
const hello = 'world';
[1, 2, 3].forEach(addNumber);
const x = function() {};
`hello`
const tag = function() {}
tag `hello`