Mar 22, 2022
I use JavaScript every day and was not aware of this issue. Thank you!
IMHO, your example shows a flaw in the Automatic Semicolon Insertion rules:
1) there is no clue in the upper line telling it is supposed to be continued
2) nothing in the bottom line tells it *is* a continuation
The proof of the flaw: developers are surprised by this behavior, because no one would/should split code lines like that.
I made my own JavaScript linter. It would handle this case pretty well.
https://medium.com/codex/making-your-own-javascript-linter-part-1-ee9f91dc49d8