Skip to content

Commit 3e6877a

Browse files
committed
Grunt: Fixed jshint options.
1 parent ccbfd45 commit 3e6877a

File tree

1 file changed

+56
-37
lines changed

1 file changed

+56
-37
lines changed

grunt.js

Lines changed: 56 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -278,52 +278,71 @@ grunt.initConfig({
278278
}
279279
}
280280
},
281-
jshint: {
282-
options: {
281+
jshint: (function() {
282+
var defaults = {
283283
curly: true,
284+
eqnull: true,
284285
eqeqeq: true,
285-
immed: true,
286+
expr: true,
286287
latedef: true,
287288
newcap: true,
288289
noarg: true,
289-
sub: true,
290-
undef: true,
291-
eqnull: true
292-
},
293-
grunt: {
294-
options: {
295-
node: true
296-
},
297-
globals: {
298-
task: true,
299-
config: true,
300-
file: true,
301-
log: true,
302-
template: true
290+
onevar: true,
291+
// TODO: limit to multi-line comments https://github.com/jshint/jshint/issues/503
292+
smarttabs: true,
293+
// TODO: use "faux strict mode" https://github.com/jshint/jshint/issues/504
294+
// strict: true,
295+
// TODO: enable trailing
296+
// trailing: true,
297+
undef: true
298+
};
299+
300+
function extend( a, b ) {
301+
for ( var prop in b ) {
302+
a[ prop ] = b[ prop ];
303303
}
304-
},
305-
ui: {
306-
options: {
307-
browser: true
304+
return a;
305+
}
306+
307+
return {
308+
options: defaults,
309+
grunt: {
310+
options: extend({
311+
node: true
312+
}, defaults ),
313+
globals: {
314+
task: true,
315+
config: true,
316+
file: true,
317+
log: true,
318+
template: true
319+
}
308320
},
309-
globals: {
310-
jQuery: true
311-
}
312-
},
313-
tests: {
314-
options: {
315-
jquery: true
321+
ui: {
322+
options: extend({
323+
browser: true,
324+
jquery: true
325+
}, defaults ),
326+
globals: {
327+
Globalize: true
328+
}
316329
},
317-
globals: {
318-
module: true,
319-
test: true,
320-
ok: true,
321-
equal: true,
322-
deepEqual: true,
323-
QUnit: true
330+
tests: {
331+
options: extend({
332+
browser: true,
333+
jquery: true
334+
}, defaults ),
335+
globals: {
336+
module: true,
337+
test: true,
338+
ok: true,
339+
equal: true,
340+
deepEqual: true,
341+
QUnit: true
342+
}
324343
}
325-
}
326-
}
344+
};
345+
})()
327346
});
328347

329348
grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {

0 commit comments

Comments
 (0)