]> source.dussan.org Git - jquery.git/commitdiff
Add onevar to jshintrc, but remove the option for linting the concatenated file
authorTimmy Willison <timmywillisn@gmail.com>
Tue, 9 Apr 2013 16:48:34 +0000 (12:48 -0400)
committerTimmy Willison <timmywillisn@gmail.com>
Tue, 9 Apr 2013 16:48:34 +0000 (12:48 -0400)
Gruntfile.js
src/.jshintrc

index 9d9f85a2091fad4499945e4d4cc1026e2c6fa776..e753a35cbdeca5142ab6ecbcafeb43f0eb18aaa9 100644 (file)
@@ -14,7 +14,12 @@ module.exports = function( grunt ) {
                                data = grunt.file.readJSON( filepath );
                        } catch(e) {}
                        return data;
-               };
+               },
+               srcHintOptions = readOptionalJSON("src/.jshintrc");
+
+       // The concatenated file won't pass onevar
+       // But our modules can
+       delete srcHintOptions.onevar;
 
        grunt.initConfig({
                pkg: grunt.file.readJSON("package.json"),
@@ -73,9 +78,7 @@ module.exports = function( grunt ) {
                jshint: {
                        dist: {
                                src: [ "dist/jquery.js" ],
-                               options: {
-                                       jshintrc: "src/.jshintrc"
-                               }
+                               options: srcHintOptions
                        },
                        grunt: {
                                src: [ "Gruntfile.js" ],
index 71e505e1d4fd0ba7a418b7b8591af1f8182bca79..c61a8325df3dcb73268ef3823ee2d6e1b9109296 100644 (file)
@@ -6,6 +6,7 @@
        "expr": true,
        "immed": true,
        "noarg": true,
+       "onevar": true,
        "quotmark": "double",
        "smarttabs": true,
        "trailing": true,