I am using JSLint to scan some Javascript code for potential errors. I'm using Notepad++ with the JSLint plugin. The problem is - it just scans, say x%
of file and then stops. I have unchecked the Stop on first error option too but I get the same result. It still stops after scanning only a part of rhe file. Is there anyway to make JSLint scan the whole file instead of some percent of file?
Edit:
I've set the maxerr
option to 10000, but the scan stops at just 41 errors and displays (1% scanned)
Edit 2:
Currently, my JSLint options look like this:
/*jslint indent: 50, maxerr: 10000, passfail: false, safe: true, adsafe: true, debug: true, evil: false, continue: true, css: false, on: false, fragment: false, es5: true, bitwise: true, regexp: false, eqeq: true */
There's a maximum number of errors option that defaults to 50
Maximum number of errors
maxerr
The maximum number of warnings reported. (default is 50)
You can see all the options on the jsLint website.
Set it to a few thousand and it should be fine :)
This seems to be a special case for having variables not at the top of the file. You can try setting undef
or vars
to true. If you don't like that you might consider jsHint, a fork of jsLint thats designed to be more configurable.
I had this same problem of it stopping after it reached 2% or so.
It seems as though JSLint does NOT like for statements
. In their "read the instructions" page it even says that you shouldn't use for statements. Which I know you shouldn't use for (var x in y)
statements, but I think that for (var x = 0; x < array.length; x++)
is fine normally. But JSLint does not like it, and will give the "move vars to the top of function error" and then stop the rest of the code from scanning.
So to fix this, I just moved the two for statements I had in my code, and then it scanned just fine.
What's the actual error message when it stops? It's entirely possible that it's simply come across a parsing error that it can't get past. In which case, your remedy is to fix what JSLint is complaining about before it will process the whole file.
JSLint will often stop before it checks the entire document. Also, the maxerr
option does not exist in the current version of JSLint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With