aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/jshint-check.js58
-rw-r--r--build/post-compile.js5
2 files changed, 32 insertions, 31 deletions
diff --git a/build/jshint-check.js b/build/jshint-check.js
index a7b8d22c6..4a21309e9 100644
--- a/build/jshint-check.js
+++ b/build/jshint-check.js
@@ -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");
+ }
+ });
} \ No newline at end of file
diff --git a/build/post-compile.js b/build/post-compile.js
index afcebf278..f77a38bdc 100644
--- a/build/post-compile.js
+++ b/build/post-compile.js
@@ -1,7 +1,6 @@
#!/usr/bin/env node
-var print = require( "sys" ).print,
- fs = require( "fs" ),
+var fs = require( "fs" ),
src = fs.readFileSync( process.argv[2], "utf8" ),
version = fs.readFileSync( "version.txt", "utf8" ),
// License Template
@@ -17,4 +16,4 @@ license = license.replace( "@VERSION", version );
// Replace license block with minimal license
src = src.replace( /\/\/.*?\/?\*.+?(?=\n|\r|$)|\/\*[\s\S]*?\/\/[\s\S]*?\*\//, license );
-print( src );
+fs.writeFileSync( "dist/jquery.min.js", src, "utf8" );