Hacker News new | past | comments | ask | show | jobs | submit login

It'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.




> 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.


Fair 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]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: