Increase max number of JSLint errors. This is necessary because we have several error...
[jquery.git] / build / jslint-check.js
1 load("build/jslint.js");
2
3 var src = readFile("dist/jquery.js");
4
5 JSLINT(src, { evil: true, forin: true, maxerr: 100 });
6
7 // All of the following are known issues that we think are 'ok'
8 // (in contradiction with JSLint) more information here:
9 // http://docs.jquery.com/JQuery_Core_Style_Guidelines
10 var ok = {
11         "Expected an identifier and instead saw 'undefined' (a reserved word).": true,
12         "Use '===' to compare with 'null'.": true,
13         "Use '!==' to compare with 'null'.": true,
14         "Expected an assignment or function call and instead saw an expression.": true,
15         "Expected a 'break' statement before 'case'.": true
16
17 };
18
19 var e = JSLINT.errors, found = 0, w;
20
21 for ( var i = 0; i < e.length; i++ ) {
22         w = e[i];
23
24         if ( !ok[ w.reason ] ) {
25                 found++;
26                 print( "\n" + w.evidence + "\n" );
27                 print( "    Problem at line " + w.line + " character " + w.character + ": " + w.reason );
28         }
29 }
30
31 if ( found > 0 ) {
32         print( "\n" + found + " Error(s) found." );
33
34 } else {
35         print( "JSLint check passed." );
36 }