For what it's worth, the recommendation about semicolons came out of a thorny conversation about what to do about semicolons in classes, since new class syntax has introduces new ASI hazards.https://twitter.com/wycats/status/951548969615736832 …
We considered simply requiring semicolons for class fields but decided to go with the grain of the rest of the language and allow ASI in those positions.
-
-
However, since we were unable to avoid introducing new ASI hazards (and expect that this will happen again), we decided to be clear with the JavaScript community that memorizing a fixed set of ASI mitigation rules is no longer a viable mitigation.
Show this thread -
Using a tool that turns ambiguous cases into errors (as
@StandardJS does) does not suffer from the memorization problem, as long as programmers using the tool keep it up to date with any new syntax they wish to use.Show this thread -
But to be clear: memorizing the handful of rules that mitigated ASI in ES5 is no longer a viable way to avoid mistakes (and many existing blog posts describing this mitigation are already out of date as of ES6).
Show this thread -
If you (personally) have thought a lot about ASI and have a good reason to believe you're safe (for example you use a linting tool that you keep up to date), TC39 has decided to keep it working, even in class bodies. But as general advice, people should default to semicolons.
Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.