]> source.dussan.org Git - jquery-ui.git/commitdiff
Grunt: Fixed jshint options.
authorScott González <scott.gonzalez@gmail.com>
Mon, 2 Apr 2012 23:12:10 +0000 (19:12 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 2 Apr 2012 23:12:10 +0000 (19:12 -0400)
grunt.js

index ad4c8bd4088f146f0cec90663d0b13b7f0e378fd..1e8a197dcee08089b065e3304d50cd14e4b84786 100644 (file)
--- a/grunt.js
+++ b/grunt.js
@@ -278,52 +278,71 @@ grunt.initConfig({
                        }
                }
        },
-       jshint: {
-               options: {
+       jshint: (function() {
+               var defaults = {
                        curly: true,
+                       eqnull: true,
                        eqeqeq: true,
-                       immed: true,
+                       expr: true,
                        latedef: true,
                        newcap: true,
                        noarg: true,
-                       sub: true,
-                       undef: true,
-                       eqnull: true
-               },
-               grunt: {
-                       options: {
-                               node: true
-                       },
-                       globals: {
-                               task: true,
-                               config: true,
-                               file: true,
-                               log: true,
-                               template: true
+                       onevar: true,
+                       // TODO: limit to multi-line comments https://github.com/jshint/jshint/issues/503
+                       smarttabs: true,
+                       // TODO: use "faux strict mode" https://github.com/jshint/jshint/issues/504
+                       // strict: true,
+                       // TODO: enable trailing
+                       // trailing: true,
+                       undef: true
+               };
+
+               function extend( a, b ) {
+                       for ( var prop in b ) {
+                               a[ prop ] = b[ prop ];
                        }
-               },
-               ui: {
-                       options: {
-                               browser: true
+                       return a;
+               }
+
+               return {
+                       options: defaults,
+                       grunt: {
+                               options: extend({
+                                       node: true
+                               }, defaults ),
+                               globals: {
+                                       task: true,
+                                       config: true,
+                                       file: true,
+                                       log: true,
+                                       template: true
+                               }
                        },
-                       globals: {
-                               jQuery: true
-                       }
-               },
-               tests: {
-                       options: {
-                               jquery: true
+                       ui: {
+                               options: extend({
+                                       browser: true,
+                                       jquery: true
+                               }, defaults ),
+                               globals: {
+                                       Globalize: true
+                               }
                        },
-                       globals: {
-                               module: true,
-                               test: true,
-                               ok: true,
-                               equal: true,
-                               deepEqual: true,
-                               QUnit: true
+                       tests: {
+                               options: extend({
+                                       browser: true,
+                                       jquery: true
+                               }, defaults ),
+                               globals: {
+                                       module: true,
+                                       test: true,
+                                       ok: true,
+                                       equal: true,
+                                       deepEqual: true,
+                                       QUnit: true
+                               }
                        }
-               }
-       }
+               };
+       })()
 });
 
 grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {