jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 513 forks source link

disallowSpacesInsideParentheses: true seems to disable all other rules #2167

Closed ilyvion closed 8 years ago

ilyvion commented 8 years ago

When I leave out disallowSpacesInsideParentheses and run jscs (through grunt, if that matters), it displays >> 46 code style errors found! with my codebase. Various kinds of errors show up, like disallowImplicitTypeConversion and requireCamelCaseOrUpperCaseIdentifiers.

However, after adding "disallowSpacesInsideParentheses": true to my .jscsrc file, I instead get >> 22 files without code style errors.

The version of jscs I'm using is 2.11.0. I'm using Ubuntu Linux 15.04.

ilyvion commented 8 years ago

Turning off auto-fixing made the errors return.

My guess as to what happened is that there was a conflict between disallowSpacesInsideParentheses and requireSpacesInsideParentheses, as I had "preset": "jQuery" at the top of my file, but had only gotten to the disallow* rules. I removed the preset, and so jQuery's requireSpacesInsideParentheses: true conflicted with my disallowSpacesInsideParentheses: true, and jscs just called it quits, I guess?

markelog commented 8 years ago

Yeah, it is generally not a good idea to have two conflicting rules

ilyvion commented 8 years ago

I suggest that it should probably be considered an error state in the configuration and jscs should probably spit out an error message or something instead of just pretending that everything is fine. I'm sure I'm not going to be the only one who accidentally enabled two conflicting rules.