X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=build%2Fjslint-check.js;h=95224be7a385518610b0c5fa089464f61f92cbe3;hb=4fd6ef4adbf15abdb52f2268548b2abc9979d415;hp=e76abc0a7bd900496b03e8e1b71c5a91b01e2274;hpb=a2e1051fb4b2065fb5ebea49dc0bcc583d113187;p=jquery.git diff --git a/build/jslint-check.js b/build/jslint-check.js index e76abc0..95224be 100644 --- a/build/jslint-check.js +++ b/build/jslint-check.js @@ -1,6 +1,8 @@ -load("build/jslint.js"); - -var src = readFile("dist/jquery.js"); +var JSLINT = require("./lib/jslint").JSLINT, + print = require("sys").print, + args = process.argv, + filename = args[2], + src = require("fs").readFileSync(filename, "utf8"); JSLINT(src, { evil: true, forin: true, maxerr: 100 }); @@ -12,8 +14,8 @@ var ok = { "Use '===' to compare with 'null'.": true, "Use '!==' to compare with 'null'.": true, "Expected an assignment or function call and instead saw an expression.": true, - "Expected a 'break' statement before 'case'.": true - + "Expected a 'break' statement before 'case'.": true, + "'e' is already defined.": true }; var e = JSLINT.errors, found = 0, w; @@ -29,8 +31,8 @@ for ( var i = 0; i < e.length; i++ ) { } if ( found > 0 ) { - print( "\n" + found + " Error(s) found." ); + print( "\n" + found + " Error(s) found.\n" ); } else { - print( "JSLint check passed." ); + print( "JSLint check passed.\n" ); }