From 561dd7c65b64c688b915b3f975401039d4992e83 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 18 Dec 2013 06:08:36 +0100 Subject: [PATCH] grunt: Update grunt-contrib-jshint use built-in jshintrc parser Use built-in jshintrc option for 'jshint' config instead of parsing manually and strippig comments. node-jshint itself has supported comment parsing for a long time (which is why our Jenkins build, which doesn't even use grunt, has no problem with our .jshintrc file). But the grunt task never exposed this parser, until v0.6.4. Change-Id: Ia45a44ac49c943845a11d3fc7a0127776e99ed2a --- Gruntfile.js | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 06afc3f1af..e8e14e2c44 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -43,8 +43,9 @@ module.exports = function ( grunt ) { } }, jshint: { - options: JSON.parse( grunt.file.read( '.jshintrc' ) - .replace( /\/\*(?:(?!\*\/)[\s\S])*\*\//g, '' ).replace( /\/\/[^\n\r]*/g, '' ) ), + options: { + jshintrc: '.jshintrc' + }, all: ['*.js', 'modules/{syntaxhighlight,unicodejs,ve,ve-mw}/**/*.js'] }, jscs: { diff --git a/package.json b/package.json index 69ac85e32b..5c0a90afb4 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ ], "devDependencies": { "grunt": "0.4.2", - "grunt-contrib-jshint": "0.5.4", + "grunt-contrib-jshint": "0.6.4", "grunt-contrib-csslint": "0.1.2", "grunt-contrib-qunit": "0.2.2", "grunt-contrib-watch": "0.4.4",