We've been happily omitting semicolons for a few years now in JS ES6. But today I ran across a syntax error highlighted by WebStorm (JS language version set to JSX, ESLint) when performing a destructuring assignment. The code:
const myArray = ['123', 'abc']
let a, b
[a, b] = myArray
[a, b] = myArray
console.log ([a, b])
The code runs without a problem in a console. However Webstorm/ESLint did not like the 2nd deconstructuring assignment and was only happy if line 3 was terminated with a semicolon. What is the explanation?