jscs-dev / node-jscs

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

Weird behavior of validateIndentation - emptyLines #2218

Closed jblandry closed 8 years ago

jblandry commented 8 years ago

Hi,

I'm using jscs 3.0.1 on both and I get a weird behavior via gulp-jscs and SublimeLinter-jscs.

If I declare the emptyLines flag on validateIndentation I get an error on gulp-jscs of bad indentation on empty lines but not in Sublime Text.

If I don't declare the emptyLines flag (which should be the same) I get the error in Sublime Text but not in gulp-jscs.

markelog commented 8 years ago

@mdevils could you check it out?

richadr commented 8 years ago

I can't speak for the sublime plugin, but I'm using jscs v3 from the command line. gulp-jscs is stuck on jscs v2 (see its package.json), while a bug was fixed in jscs v3.

The bug was in the following line in the source for the rule checker: (v2) this._includeEmptyLines = options.allExcept.indexOf('emptyLines') > -1; (v3) this._includeEmptyLines = options.allExcept.indexOf('emptyLines') === -1;

Solution for gulp-jscs is to upgrade to v3.

markelog commented 8 years ago

Thanks for clarifying

jblandry commented 8 years ago

Thanks !