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
This commit is contained in:
Timo Tijhof 2013-12-18 06:08:36 +01:00 committed by Krinkle
parent 56c50b30b8
commit 561dd7c65b
2 changed files with 4 additions and 3 deletions

View file

@ -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: {

View file

@ -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",