Formatters like Prettier can help here. For example, this code contains a function call, because the first line doesn't end with a semicolon.
let a = 123
({a}= {a: 10})
Prettier will reformat it like this: let a = 123(({ a } = { a: 10 }));
You could also use ESLint to enforce semicolons.The error messages when running code like this aren't very good though.