4 ms·
Is there a preprocessor/transpiler that lets you write vanilla ES6 but just without brackets, semi-colons, etc. like CoffeeScript?
by msutherl 12y ago
Is there a preprocessor/transpiler that lets you write vanilla ES6 but just without brackets, semi-colons, etc. like CoffeeScript?
- mattdesl 12y agoSemicolons are already optional in JS. Automatic semi colon insertion (ASI) has a clear set of rules that are pretty easy to remember. http://mattdesl.svbtle.com/to-semicolon-or-not http://mattdesl.svbtle.com/to-semicolon-or-not
- SomeCallMeTim 12y agoBut ASI is controversial, because of the bugs that can be caused by it. (See "JavaScript, the Good Parts"). I make our devs (myself include) use semicolons with jshint, because I believe it's too easy to screw up.
- Already__Taken 12y agoAfter reading the linked [Isaacs](http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding http://blog.izs.me/post/2353458699/an-open-letter-to-javascr...) post it made me realise a bit more about the language. I don't think I'd agree its easy to screw up. Its as easy as accidentally using global variables.
- mattdesl 12y agojshint warns about these bugs regardless of whether you have ASI flag turned on. Writing semicolon-free code is easy. Just put a preceding semicolon before any lines beginning with: ( [ + -