grunt-contrib-jshint
grunt-contrib-jshint copied to clipboard
Specific options does not overwrite the global options from .jshintrc
According the documentation the specific options replaces the global ones, but, It's does not work, I have:
Gruntfile.js (Not complete)
jshint: {
options: {
jshintrc: true
},
grunt: {
options: {
"maxlen": false,
"strict": false
},
files: {
src: 'Gruntfile.js'
}
},
lib: {
options: {
},
files: {
src: [
'index.js',
'lib/*.js',
'lib/**/*.js'
]
}
}
}
});
.jshintrc (only the replaced options)
"strict" : true,
"maxlen" : 80,
And when I run "grunt" command (with the jshint by default), I get this:
Running "jshint:grunt" (jshint) task
Gruntfile.js
5 | grunt.initConfig({
^ Missing "use strict" statement.
11 | ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' + '\n' +
^ Line is too long.
12 | ' * License: <%= _.pluck(pkg.licenses, "type").join(", ") %> (<%= _.pluck(pkg.licenses, "url").join(", ") %>)' + '\n' +
^ Line is too long.
>> 3 errors in 1 file
Warning: Task "jshint:grunt" failed. Use --force to continue.
Aborted due to warnings.
I have installed the version 0.11.1, with node 0.12.0 and npm 2.6.0, running in Archlinux.
├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
Same problem.
+1
+1 I saw in the changelog that this was done in v0.3.0 on 2013-03-13 and reverted immediately in v0.4.0 on 2013-04-04.
Is there a reason this was removed? I'd find it very useful.
*_EDIT_* For anyone experiencing this, you can place a second .jshintrc
within the directory of secondary grunt target
and it will match the first .jshintrc
found above the file it's linting.
Hope this helps!
+1
+1