Is it possible, to make this check configurable?
"Move 'var' declarations to the top of the function."
It is possible, but it would be stupid. Scope confusion is a problem in this language.
Pick your reaction
Thanks for your answer,
It's stupid, but we have lots of for(var i =....) statements and it tooks too much time for us to refactor our code.
So, I'll be appretiated if you can make it configurable.
The purpose of JSLint is to inform you of weaknesses in your code. If you do not want that information, don't use it.
erm, sorry if I'm disturbing you but, lots of checks for these "weaknesses" can be toggled by a configuration parameter, and I want move_var parameter also to be configured by a parameter.
You can write all the crappy code you want. I don't care, because you don't work for me. The purpose of JSLint is not to make you feel good about your bad choices. It is to help you conform to a more reliable subset of the language.
I don't see how something that is clearly documented in the ECMAScript specification can be unreliable. On the contrary, it is a legitimate coding practice. You're absolutely correct that you shouldn't care about my code, but, at the same time, JSLint should not be lying to developers by falsely claiming that a certain practice is bad. Just because my code does not conform to your pedantic style does not mean that it is bad or crappy.
I am sorry I hurt your feelings.
I appreciate your efforts and am grateful for JSLint, but it would be more useful if you gave the people who use it a little more credit and allowed them to choose which stylistic variations they consider to be tolerable. The default options make your opinions plain enough.
The research that I did when developing JSLint showed that there were good reasons in this language to declare variables before that they are used. In some future edition, when let forms respect block scope, my advice will change to never use var.
If you have any evidence that violation of JSLint's rules produces programs that are provably more reliable and cruft-resistant, then I will implement your suggestion.