Closed dudkiewicz-codes closed 9 years ago
Sounds like this should be a patch submitted to grunt-contrib-jshint
On Wed, May 21, 2014 at 9:36 AM, pdudkiewicz notifications@github.com wrote:
Currently there is no way (at least I am not aware of one) to configure jshint plugin using .jshintrc file. I have to copy jshint options to application.js from .jshintrc. As a result I end up with duplicated jshint configuration - one for lineman, one for code editor.
It would be nice to load options from .jshintrc by default (or at least to have an option to specify path to .jshintrc file).
Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/269
There is jshintrc option in grunt-contrib-jshint : https://github.com/gruntjs/grunt-contrib-jshint#jshintrc but it doesn't work with lineman.
jshint: {
options: {
jshintrc: true
}
}
Running
lineman config jshint.options
prints:
{
"curly": true,
"eqeqeq": true,
"latedef": true,
"newcap": true,
"noarg": true,
"boss": true,
"eqnull": true,
"sub": true,
"browser": true,
"jshintrc": true
}
As a workaround I will use:
jshint: {
options: JSON.parse(require('fs').readFileSync('.jshintrc'))
}
Ah if there is that option then lineman ought to support it. Is it simply a version issue? (Install latest jshint to your project to see)
On Wed, May 21, 2014 at 10:41 AM, pdudkiewicz notifications@github.com wrote:
There is jshintrc option in grunt-contrib-jshint : https://github.com/gruntjs/grunt-contrib-jshint#jshintrc but it doesn't work with lineman. jshint: { options: { jshintrc: true } } Running lineman config jshint.options prints: { "curly": true, "eqeqeq": true, "latedef": true, "newcap": true, "noarg": true, "boss": true, "eqnull": true, "sub": true, "browser": true, "jshintrc": true } As a workaround I will use: jshint: { options: JSON.parse(require('fs').readFileSync('.jshintrc'))
}
Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/269#issuecomment-43763050
Same situation with grunt-contrib-jshint 0.10.0.
lineman config jshint
will only show the config options provided in our application config files. However, the grunt-contrib-jshint task ignores any grunt-supplied options if jshintrc
is true. It doesn't merge the options, it just uses the jshintrc file alone. When actually running lineman with jshintrc:true
, does it respect the lineman config or the jshintrc file? (Keeping in mind that what lineman config jshint
shows you would be a lie.)
I just confirmed that jshintrc: true
does indeed work as expected. .jshintrc placed in root of project (not under /app or /config). When jshintrc is true, and grunt-contrib-jshint is reading from the jshintrc file, options provided by lineman/grunt are ignored. Only the options in the jshintrc file are respected. (As per grunt-contrib-jshint docs.)
Verified with lineman 0.29.3 and grunt-contrib-jshint 0.10.0.
Currently there is no way (at least I am not aware of one) to configure jshint plugin using .jshintrc file. I have to copy jshint options to application.js from .jshintrc. As a result I end up with duplicated jshint configuration - one for lineman, one for code editor. It would be nice to load options from .jshintrc by default (or at least to have an option to specify path to .jshintrc file).