diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2011-12-08 20:42:47 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-12-08 21:04:57 -0500 |
commit | 98386cfd775fdfa7837ccbec173b04f1e6d57896 (patch) | |
tree | 74783699ba88a0bf17bfb88e8b3e8141b7c868fe /build/jshint-check.js | |
parent | d6500cc8ded8d3d02e19a3ab831b6b9cf43e82ae (diff) | |
download | jquery-98386cfd775fdfa7837ccbec173b04f1e6d57896.tar.gz jquery-98386cfd775fdfa7837ccbec173b04f1e6d57896.zip |
Fix #10692. JSLint is dead! Long live JSHint!
Still needs this sizzle PR: https://github.com/jquery/sizzle/pull/82
Diffstat (limited to 'build/jshint-check.js')
-rw-r--r-- | build/jshint-check.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/build/jshint-check.js b/build/jshint-check.js new file mode 100644 index 000000000..92553f193 --- /dev/null +++ b/build/jshint-check.js @@ -0,0 +1,35 @@ +var JSHINT = require("./lib/jshint").JSHINT, + print = require("sys").print, + src = require("fs").readFileSync("dist/jquery.js", "utf8"); + +JSHINT(src, { + evil: true, + undef: false, + browser: true, + wsh: true, + eqnull: true, + expr: true, + curly: true, + eqeq: true, + trailing: true, + predef: [ + "define", + "DOMParser" + ], + maxerr: 100 +}); + +var e = JSHINT.errors, found = e.length, i = 0, w; + +for ( ; i < e.length; i++ ) { + w = e[i]; + + print( "\n" + w.evidence + "\n" ); + print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason ); +} + +if ( found > 0 ) { + print( "\n" + found + " Error(s) found.\n" ); +} else { + print( "JSHint check passed.\n" ); +}
\ No newline at end of file |