brunch / jshint-brunch

Adds JSHint linting support to Brunch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad option: 'enforceall'

dnjstrom opened this issue · comments

I have a simple jshint setup with brunch-jshint config looks like this:

plugins: {
    jshint: {
        pattern: /^app\/.*\.js$/
    }
}

and an .jshintrc file which looks like this:

{
    "enforceall": true
}

jshint-brunch is set as a dependency in package.json like so:

"jshint-brunch": "latest",

When I run brunch build I get this error:

 error: Linting of 'app/main.js' failed. Bad option: 'enforceall'.

I also get the same error when I specify enforceall through the brunch-config.js file. Specifying other options works fine. Running jshint on the command line manually specifying the .jshintrc-file works as it should.

How come enforceall doesn't work when I use the brunch wrapper?

Perhaps you need to npm update? What does npm ls say?

Also you should be aware that option may get dropped regardless jshint/jshint#2045

npm update didn't make any difference, but npm ls provides the following for jshint-brunch:

├─┬ jshint-brunch@1.7.0
│ └─┬ jshint@2.3.0

As you can see, jshint-brunch is using an old jshint version (current is 2.6.0). I checked out the available options for the 2.3.0 version and it appears it simply doesn't support enforceall.

How come jshint-brunch uses such an old version of jshint? Maybe it'd be a good idea to update the project dependencies?

(For anyone finding this issue in the future, one solution is to force the jshint-brunch to use a newer jshint version using shrinkwrap as described in this stackoverflow question, though it does feel like a hack.)

https://github.com/brunch/jshint-brunch/blob/master/package.json#L17

If npm update didn't work, try npm i and consider reporting the bug to npm

The line you link to is on the master branch, while the 1.7.0 release still uses 2.3.0. Are you saying I should set the wrapper to use the version in the master branch instead of the latest release? That sounds very strange to me. Wouldn't the prefered solution be to make a new release (minor or major) of jshint-brunch. Or are you telling me to use jshint-brunch as a git dependency until the next release of the wrapper?

Oh my bad, sorry about that. Didn't recognize the latest changes hadn't been published yet. Will do it today.

Awesome! Thank you for helping me!

published 1.8.0