4 ms·
Seems like everyone should just be using an automated tool to catch missing/extra semicolons. No reason not to at this point, and eslint even autofixes them for
by epmatsw 11y ago
Seems like everyone should just be using an automated tool to catch missing/extra semicolons. No reason not to at this point, and eslint even autofixes them for you.
- taylorwc 11y agoThat was my exact reaction too--I wonder how many people who spend any meaningful amount of time in javascript do so without a good linter.
- hyperpape 11y agoOutside of work, I spent a month or two writing little demos for my kids in javascript using notepad. My old computer had died and I was borrowing one. This was in ~2014 maybe?
- kevan 11y agoYep, this is in our ESLint config: "semi": [2, "never"], // Disallow semicolons "no-unexpected-multiline": 2, // Prevent edge cases caused by excluding semicolons. And I haven't thought about it since. I'd expect an article like this 5 years ago, but it feels like bikeshedding at this point. If you choose to not use semicolons then add lint rules to protect against the edge cases and stop wasting brainpower on it.