1 var JSLINT = require("./lib/jslint").JSLINT,
2 print = require("sys").print,
5 src = require("fs").readFileSync(filename, "utf8");
7 JSLINT(src, { evil: true, forin: true, maxerr: 100 });
9 // All of the following are known issues that we think are 'ok'
10 // (in contradiction with JSLint) more information here:
11 // http://docs.jquery.com/JQuery_Core_Style_Guidelines
13 "Expected an identifier and instead saw 'undefined' (a reserved word).": true,
14 "Use '===' to compare with 'null'.": true,
15 "Use '!==' to compare with 'null'.": true,
16 "Expected an assignment or function call and instead saw an expression.": true,
17 "Expected a 'break' statement before 'case'.": true,
18 "'e' is already defined.": true
21 var e = JSLINT.errors, found = 0, w;
23 for ( var i = 0; i < e.length; i++ ) {
26 if ( !ok[ w.reason ] ) {
28 print( "\n" + w.evidence + "\n" );
29 print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
34 print( "\n" + found + " Error(s) found.\n" );
37 print( "JSLint check passed.\n" );