aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2012-06-25 10:49:21 -0400
committerRick Waldron <waldron.rick@gmail.com>2012-06-25 10:49:21 -0400
commit96246332f723b0f83e465d0f9f580741c8272f80 (patch)
tree203fc3de5e286c17c91eb0a421e6a2072398d5ec
parentc436ae04de80f8d232b5456f605331ecfaba4f49 (diff)
downloadjquery-96246332f723b0f83e465d0f9f580741c8272f80.tar.gz
jquery-96246332f723b0f83e465d0f9f580741c8272f80.zip
Adds .jshintrc files for: grunt (default set), src, tests; Adapts jQuery-UI loading method
-rw-r--r--.jshintrc11
-rw-r--r--grunt.js80
-rw-r--r--src/.jshintrc27
-rw-r--r--test/.jshintrc56
4 files changed, 114 insertions, 60 deletions
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 000000000..fd498d83b
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,11 @@
+{
+ "curly": true,
+ "eqnull": true,
+ "eqeqeq": true,
+ "expr": true,
+ "latedef": true,
+ "noarg": true,
+ "smarttabs": true,
+ "trailing": true,
+ "undef": true
+}
diff --git a/grunt.js b/grunt.js
index cde713c04..ab693def5 100644
--- a/grunt.js
+++ b/grunt.js
@@ -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: {}
});
diff --git a/src/.jshintrc b/src/.jshintrc
new file mode 100644
index 000000000..faf031dfd
--- /dev/null
+++ b/src/.jshintrc
@@ -0,0 +1,27 @@
+{
+ "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
+ }
+}
diff --git a/test/.jshintrc b/test/.jshintrc
new file mode 100644
index 000000000..13039f827
--- /dev/null
+++ b/test/.jshintrc
@@ -0,0 +1,56 @@
+{
+ "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
+ }
+}