4 ms·
Totally agree. It then leads to this stupidity: "Never start a line with (, [, or `." https://github.com/feross/standard/blob/master/RULES.md#semicolons https:/
by joesmo 10y ago
Totally agree. It then leads to this stupidity: "Never start a line with (, [, or `." https://github.com/feross/standard/blob/master/RULES.md#semicolons https://github.com/feross/standard/blob/master/RULES.md#semi...
Now I have 4 extra rules to remember and destructuring, amongst other things, will look like shit. And for what gain? If there was an actual gain to leaving out the semicolons, I'd be onboard but the only gain here is someone's aesthetic pleasure and someone else's aesthetic displeasure. Last time I checked, code was there to do things, not look pretty. Making the former more difficult to achieve the latter is not only stupid, it's impossible because now you're pandering to fashion which varies from person to person. Also, it's bikeshedding. As if Javascript didn't have real problems it needs solved.
- WorldMaker 10y agoIt's one "extra" rule. I call it the "Winky Frown Rule" or you could less cheekily refer to it as something of a "Complete Emoji Rule": lines that start with frowns (, [, ` should be winky frowns: ;(, ;[, ;` 95% of the time I ever use a winky frown is Typescript type assertions ;(<any>someObj)... It doesn't impact destructuring at all because destructuring lines start with let (or const, or maybe var if you are feeling old school that day). ASI is not very different at all from the newline rules in Python, ML, Haskell, et al... Freedom from semicolons makes ES2015 feel like the OCaml derivative it always sort of has been.
- bakkoting 10y ago> It doesn't impact destructuring at all because destructuring lines start with let That's just not true. You can have destructuring assignments, not just declarations: `[a, b] = [b, a];` is perfectly legal ES2015.
- WorldMaker 10y agoFair enough, not a use case I'd encountered a need for in my code, yet. Still not that "ugly" from a winky frown perspective: ;[a, b] = [b, a]