sublimetext2 - Disabling or Overriding JSLint Options in Sublime Text 2 -


i have jslint plugin installed in sublime text 2. don't agree of rules imposed jslint specially error on declaring variables inside loop.

move 'var' declarations top of function.     (var = 0; < 100; i++) { // line 12, pos 10 

my question how can override or disable rule in jslint on sublime text 2.

if have darren deridder's plugin (there 2 jslint plugins sublime text), this:

you can set of jslint's options under preference -> package settings -> jslint -> advanced built settings. see http://www.jslint.com/lint.html#options list of options in jslint.

now you're going have hard time disabling just var declarations within loops. can turn vars option true, jslint let have many var declarations want, anywhere on page. can misleading practice, javascript has call function scope , "hoists" declarations top of scope.

edit: argh, lied. vars allows multiple var declaration statements, still have @ top of function. allows this:

function fntest() {   var i;   var j;  // oh boy! 2 var statements @ top of same function   (i = 0; < 100; i++) {     j++;   } } 

and not

function fntest() {   var j;   (var = 0; < 100; i++) { // still can't this.     j++;   } } 

though i'm surprised crockford doesn't let this, think you're out of luck, , have use jshint instead (there seems sublime plugin for jshint here, though haven't used it).


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -