This automatic insertion fails in a few cases. The most common trap is starting a line with parentheses or brackets:
let x = 5
(function() { console.log(x) })()
This gets interpreted as 5(function...), trying to call as a function. Fix it by adding a semicolon before the parenthesis, or simply avoid starting lines with ( or [. If you use semicolons consistently, you won't hit these edge cases.