From ac9cad19fa0473315489ee952ba73afdaeb80386 Mon Sep 17 00:00:00 2001 From: Timmy Willison Date: Tue, 9 Apr 2013 12:48:34 -0400 Subject: [PATCH] Add onevar to jshintrc, but remove the option for linting the concatenated file --- Gruntfile.js | 11 +++++++---- src/.jshintrc | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9d9f85a20..e753a35cb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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" ], diff --git a/src/.jshintrc b/src/.jshintrc index 71e505e1d..c61a8325d 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -6,6 +6,7 @@ "expr": true, "immed": true, "noarg": true, + "onevar": true, "quotmark": "double", "smarttabs": true, "trailing": true, -- 2.39.5