diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2012-06-25 10:49:21 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2012-06-25 10:49:21 -0400 |
commit | 96246332f723b0f83e465d0f9f580741c8272f80 (patch) | |
tree | 203fc3de5e286c17c91eb0a421e6a2072398d5ec /grunt.js | |
parent | c436ae04de80f8d232b5456f605331ecfaba4f49 (diff) | |
download | jquery-96246332f723b0f83e465d0f9f580741c8272f80.tar.gz jquery-96246332f723b0f83e465d0f9f580741c8272f80.zip |
Adds .jshintrc files for: grunt (default set), src, tests; Adapts jQuery-UI loading method
Diffstat (limited to 'grunt.js')
-rw-r--r-- | grunt.js | 80 |
1 files changed, 20 insertions, 60 deletions
@@ -5,6 +5,7 @@ * */ +/*jshint node: true */ /*global config:true, task:true, process:true*/ module.exports = function( grunt ) { @@ -14,8 +15,8 @@ module.exports = function( grunt ) { function readOptionalJSON( filepath ) { var data = {}; try { - data = grunt.file.readJSON(filepath); - grunt.log.write( "Reading data from " + filepath + "..." ).ok(); + data = grunt.file.readJSON( filepath ); + grunt.verbose.write( "Reading " + filepath + "..." ).ok(); } catch(e) {} return data; } @@ -81,9 +82,25 @@ module.exports = function( grunt ) { min: { "dist/jquery.min.js": [ "<banner>", "dist/jquery.js" ] }, + lint: { - files: [ "test/unit/**/*.js", "grunt.js", "dist/jquery.js" ] + dist: "dist/jquery.js", + grunt: "grunt.js", + tests: "tests/unit/**/*.js" }, + + jshint: (function() { + function jshintrc( path ) { + return readOptionalJSON( (path || "") + ".jshintrc" ) || {}; + } + + return { + options: jshintrc(), + dist: jshintrc( "src/" ), + tests: jshintrc( "test/" ) + }; + })(), + qunit: { files: "test/index.html" }, @@ -91,63 +108,6 @@ module.exports = function( grunt ) { files: [ "<config:lint.files>", "src/**/*.js" ], tasks: "dev" }, - jshint: { - options: { - evil: true, - browser: true, - wsh: true, - eqnull: true, - expr: true, - curly: true, - trailing: true, - undef: true, - smarttabs: true, - maxerr: 100 - }, - globals: { - define: true, - DOMParser: true, - __dirname: true, - jQuery: true, - global: true, - module: true, - exports: true, - require: true, - file: true, - log: true, - console: true, - QUnit: true, - ok: true, - equal: true, - test: true, - asyncTest: true, - notEqual: true, - deepEqual: true, - strictEqual: true, - notStrictEqual: true, - start: true, - stop: true, - expect: true, - raises: true, - testIframe: true, - testIframeWithCallback: true, - createDashboardXML: true, - moduleTeardown: true, - testFoo: true, - foobar: true, - url: true, - t: true, - q: true, - amdDefined: true, - fireNative: true, - hasPHP: true, - isLocal: true, - originaljQuery: true, - "$": true, - "original$": true - - } - }, uglify: {} }); |