jscs-dev/grunt-jscs

"Unsupported rule" errors in grunt-jscs v2.7.0 using jscs v2.9.0

michael-fosgerau opened this issue · 3 comments

Hi there,

With a fresh installation of:

npm install --save-dev jscs
npm install --save-dev grunt-jscs

I get a number of errors trying to validate my javascript code style that are due to "unsupported rules". It seems the current release of jscs / grunt-jscs are not working together, or, that a number of rules in the presets are actually not available.

Running "jscs:app" (jscs) task
requireSpaceBeforeObjectValues: Unsupported rule: reporter at ../Scripts/error.js :
     1 |require([], function () {
--------^

I'm using the "crockford" preset.

Many more unsupported rules appear. Please fix this or advise on how to remedy it.

Thanks in advance! :-)

Best regards,
Michael

I have the same problem. In my case it is:
Unsupported rule: files.
It's strange that reporter and files are options of the grunt-jscs and I don't know if it is about them. In my case I've removed the files option from the config and nothing changed. Can you try to remove the reporter and try again?

Thanks,
Nikolay

Interesting. And confusing :-/

Without "reporter": "console" in my .jscsrc file the unsupported rule errors go away.

So this is a problem with the config section and/or the individual reporters then.

.jscsrc with reporters set:

{
    "maxErrors": 100,
    "reporter": "console",
    "preset": "crockford",
    "validateIndentation": 4, // 4 spaces
    "esnext": false,
    "verbose": true,
    "fix": false
}

Gives me this:

$ grunt codestyle | grep -i "unsup"
requireLineFeedAtFileEnd: Unsupported rule: reporter at somefile.js :
requireLineFeedAtFileEnd: Unsupported rule: reporter at somefile2.js : 
(any many more)
$

And if I comment out the reporter line in the .jscsrc configuration I get this:

$ grunt codestyle | grep -i "unsup"
$

reporter option can't be used in .jscsrc config