Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Reformat jshint errors to be readable; make post-compile.js write dir…
…ectly to jquery.min.js; update required Node version
- Loading branch information
Showing
4 changed files
with
34 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
var JSHINT = require("./lib/jshint").JSHINT, | ||
print = require("sys").print, | ||
src = require("fs").readFileSync("dist/jquery.js", "utf8"); | ||
var jshint = require("./lib/jshint").JSHINT, | ||
src = require("fs").readFileSync("dist/jquery.js", "utf8"), | ||
config = { | ||
evil: true, | ||
undef: false, | ||
browser: true, | ||
wsh: true, | ||
eqnull: true, | ||
expr: true, | ||
curly: true, | ||
trailing: true, | ||
predef: [ | ||
"define", | ||
"DOMParser" | ||
], | ||
maxerr: 100 | ||
}; | ||
|
||
JSHINT(src, { | ||
evil: true, | ||
undef: false, | ||
browser: true, | ||
wsh: true, | ||
eqnull: true, | ||
expr: true, | ||
curly: true, | ||
trailing: true, | ||
predef: [ | ||
"define", | ||
"DOMParser" | ||
], | ||
maxerr: 100 | ||
}); | ||
if ( jshint( src, config ) ) { | ||
console.log("JSHint check passed."); | ||
} else { | ||
|
||
var e = JSHINT.errors, found = e.length, i = 0, w; | ||
console.log( "JSHint found errors." ); | ||
|
||
for ( ; i < e.length; i++ ) { | ||
w = e[i]; | ||
jshint.errors.forEach(function( e ) { | ||
if ( !e ) { return; } | ||
|
||
print( "\n" + w.evidence + "\n" ); | ||
print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason ); | ||
} | ||
var str = e.evidence ? e.evidence : ""; | ||
|
||
if ( found > 0 ) { | ||
print( "\n" + found + " Error(s) found.\n" ); | ||
} else { | ||
print( "JSHint check passed.\n" ); | ||
if ( str ) { | ||
str = str.replace( /\t/g, " " ).trim(); | ||
|
||
console.log( " [L" + e.line + ":C" + e.character + "] " + e.reason + "\n " + str + "\n"); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters