Is "Bad Line Break" obsolete with "using strict"?

Suppose "use strict"; and suppose JSLint is enabled and errors cannot be ignored.

I find the operators and ',' initiated lists are so readable

eg:.

var i = 0 , j = 1 , someLongVariablename1 , someLongVariablename2 , someLongVariablename3 , someLongVariablename4; if( ( 'dcr' === cmd && (action) && ('get' === actionHttp || 'post' === actionHttp ) && whatever ) { ... } 

Hence my question:
Is "Bad Linear Breaking" an obsolete "rigor"?

EDITED: 'use strict'; will not prevent the execution of an invalid line that violates the code. This may prevent some errors from occurring.

I see that JSLint and JSHint belong to a bad line, breaking it. JSHint is much more syntax friendly, which I prefer.

So, this may be a solution for others who are working on it.

+7
source share
1 answer

Unfortunately, strict mode does not disable horror, which is an automatic semicolon , and therefore "bad" line breaks remain a problem. For example:

 (function() { "use strict"; console.log(foo()); function foo() { var a = 1, b = 2; return a + b; } })(); 

Live example | Source (you need to open the console and see it)

This still writes undefined , not 3 , because ASI starts up and adds a semicolon after return to foo .

+5
source

All Articles