From: Scott González Date: Mon, 2 Apr 2012 23:12:10 +0000 (-0400) Subject: Grunt: Fixed jshint options. X-Git-Tag: 1.9.0m8~163 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3e6877a892b8fb70f1130f639dfde09ce5af6236;p=jquery-ui.git Grunt: Fixed jshint options. --- diff --git a/grunt.js b/grunt.js index ad4c8bd40..1e8a197dc 100644 --- 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() {