I see these warnings a lot, but I work on a team that does not ever use semicolons, and hasn't for years. It is simply not a problem, I don't know what else to say. And I have come to really dislike the syntactic noise the semicolons add.
Do you use ; at end of var declarations? If not, beware; if so, do you use comma-first? Thanks for answers, just curious.
About the concatenation, we use Browserify which bundles our code for us. The beginning of a Browserify bundle is a definition for the `require` function.
always var foo = 'bar';
If you do comma first, I will automatically assume you're an idiot.
Two, stop making stupid assumptions.
var foo = 'bar',
baz = 'bletch'
(function (global) {
//module pattern code here ...
})(this);
then you have trouble. Semicolons are not optional (meaning always optional, you can leave them out at will). Please read my blog post. var foo = 'bar'
var baz = 'bletch'
void function (global) {
//module pattern code here ...
})(this)Now is:
module.exports = function(){}; var foo = 1
var bar = 2
Is there an issue with semicolon-free var declarations that I should be aware of? var a = 2
,b = "tan"
,c = "gent"
;
Keeps the var block distinctly visible in a function and in case you add a new variable there's only one line diff.