JSLint has reached the limit of 1,000 errors or it is confused by earlier errors and can't continue

StackOverflow https://stackoverflow.com/questions/18037976

  •  23-06-2022
  •  | 
  •  

Question

I'm using jsLint and CodeKit to validate my js. The .js itself is pretty minimal, and I have overcome all the issues jsLint has reported. But this one error never seems to go away: "JSLint has reached the limit of 1,000 errors or it is confused by earlier errors and can't continue. Fix the issues above and try again. [col. -1]" I have no clue how to overcome this.

/*jslint browser: true, forin: true, white: false, on: true, fragment: true, eqeqeq: true */
var app = (function (w, d) {

'use strict';

var foo = 'bar';
return {
    init : function() {
        console.log(foo); 
    }
};


})(window, document);

window.onload = app.init;

Any ideas?

Was it helpful?

Solution

You've got some JS*H*int options (like eqeqeq, apparently) in the jslint line. It's choking there.

So change...

/*jslint browser: true, forin: true, white: false, on: true, fragment: true, eqeqeq: true */

... to ...

/*jslint browser: true, forin: true, white: false */

... and I bet it works.

Note: It's almost always a good idea to get a simplest case example of code that's screwing up in JSLint and paste it into JSLint.com. Crockford keeps that URL all but up to the minute with JSLint's github repo, and it was reporting a much more user-friendly error (Unexpected 'on'.) than the unfortunate "JSLint's confused" it was telling you.

Just to make sure there wasn't something else making JSLint think there were 1000+ errors, I changed your white to true, removed the unused w and d, and another change or two so that it'd pass linting, and this works on jslint.com:

/*jslint browser: true, forin: true, white: true, sloppy: true */
var app = (function () {

    'use strict';

    var foo = 'bar';
    return {
        init : function() {
            window.console.log(foo); 
        }
    };


}(window, document));

window.onload = app.init;

So it's probably just those JSHint-specific settings that don't work in JSLint that was borking things.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top