|
|
|
|
|
by tauchunfall
4037 days ago
|
|
>Unfortunately the rules are complex, prone to certain errors, and I can't rely on everyone I ever work with understanding all of those rules. Are they really complex? This recently released version 4.0.0 of the JavaScript Standard Style [1] suggests to never start a line with "(" or "[". This rule looks even simpler than the rules of operator precedence. [1] https://github.com/feross/standard Update: Now I learned about the JavaScript Semi-Standard Style [2] which accually enforces semi-colons. Quite hilarious. [2] https://github.com/Flet/semistandard |
|
One quick example is the very contrived example that follows.
return {a:1, b:2}
That is valid JavaScript. It is evaluated as an empty return and an unreachable expression. Probably not what was intended.
I've sent copies of the rules to people and explained them numerous times, but at the end of the day it is more productive to just use them and move on to something else IMHO.