I have 10 years of experience being a JavaScript developer and I forget that semicolon is optional. Adding a semicolon in the end is a simple insti...
For further actions, you may consider blocking this person and/or reporting abuse
There are cases where a semi is always required, i.e.
I prefer using semis always rather than having to use them as exception, which IMO break the code style
My usual stance on this is whatever my auto-formatter adds automatically.
Prettier has an option to toggle this behavior on and off.
Few argue about spacing in code because it's usually automatically added/removed via tooling. As long as it's consistent within the codebase it usually isn't an area of contention.
I believe semi-colons should be in the same boat. Just let the computer add/remove/apply them. The few edge-cases should be handled by other tooling, like TypeScript.
Thanks it is something new to me
Auto-formatted by what? I've never seen auto-formatting do that before.
I use Standard JS. q.v. my other post reply.
In an Edna Mode voice, "No semicolons!"
Josh Perez No, you don't need semicolons. And when a semicolon is necessary, I use Max Bendick Semicolons go at the beginning of the line.
I advise to always use them.
I know that Python and JavaScript are the most popular ones and it's cheap to skip them, but since most languages use them anyway, it's better to use them for me. Besides, I think the code is a bit clearer with semicolons.
It's not what format that matters, it's just one format, for that matter, I configure the npm package with a custom prettier preset
github.com/rxliuli/liuli-tools/tre...
Nope, stopped using em a while ago and never looked back. Fecking linters put them back in anyways so who cares.
I think they exist because there was a time without syntax highlighting and you need to see where the end is.
I mean you can put semicolons in Python if you want everyone to hate you
I always use semicolons. Got so used to it that I have to keep reminding myself to stop using them in a language like python... xD