3 ms·
Try it! If you learn about why semicolons were recommended for js, it's pretty easy to avoid writing code that would land you in trouble in the semicolon-free w
by krisdol 11y ago
Try it! If you learn about why semicolons were recommended for js, it's pretty easy to avoid writing code that would land you in trouble in the semicolon-free world. Most likely you wouldn't be getting in trouble in the first place since most of the examples had me thinking "why would I ever write code like this?". Besides, I think that recommendation maybe came from a time when the ASI was unreliable and linters were not common. My eslint is awesome at keeping me out of trouble.
For good reading, have a look at the linked articles at the bottom here http://eslint.org/docs/rules/semi.html http://eslint.org/docs/rules/semi.html
- glenjamin 11y agoThere are a few scenarios where you can get bitten by missing out semicolons. However, this eslint rule should save you: http://eslint.org/docs/rules/no-unexpected-multiline http://eslint.org/docs/rules/no-unexpected-multiline