5 ms·
Much better than "Standard JS" and its choice of no semicolons. I know about "Semi Standard JS", but I refuse to accept such a little difference that could be a
by rhengles 10y ago
Much better than "Standard JS" and its choice of no semicolons. I know about "Semi Standard JS", but I refuse to accept such a little difference that could be a configuration has to live in a entirely new project.
- Touche 10y agoNote that Standard is a linter, this is a reformatter. Standard gives you errors but doesn't fix things for you.
- acdha 10y agohttps://github.com/feross/standard#is-there-an-automatic-formatter https://github.com/feross/standard#is-there-an-automatic-for... “You can use standard --fix to automatically fix most issues automatically. standard --fix is built into standard (since v8.0.0) for maximum convenience. Lots of problems are fixable, but some errors, like forgetting to handle the error in node-style callbacks, must be fixed manually.”
- kasbah 10y agoBut the linked formatter doesn't seem to have an option for no semicolons so I wouldn't call it better in that regard. EDIT: Looks like they may be open to it though. https://github.com/jlongster/prettier/issues/12 https://github.com/jlongster/prettier/issues/12
- russellbeattie 10y agoSemicolons are not optional in JavaScript: ASI (http://www.ecma-international.org/ecma-262/6.0/#sec-automatic-semicolon-insertion http://www.ecma-international.org/ecma-262/6.0/#sec-automati...) is an error correction scheme for novice programmers. The spec's parsing rules calls out the statements following where a semicolon should be "offending tokens". There is no leeway here for style or preference.
- kasbah 10y agoThe thing is, they made the "error correction scheme" work so well that they are no longer required. Give it a go sometime; you might like it.
- hokkos 10y agoI hate that they had the audacity to call it standard.