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

requireSemicolons and requirePaddingNewLinesAfterBlocks combined report wrong line #2245

Closed Arcanemagus closed 8 years ago

Arcanemagus commented 8 years ago

When running jscs v3.0.3 against this file:

example2.js:

{}
console.log(false)

With this configuration:

.jshintrc:

{
  "requirePaddingNewLinesAfterBlocks": true,
  "requireSemicolons": true
}

JSCS is reporting the requireSemicolons error on line 3 instead of line 2. I get the same results when running on the CLI with the default and JSON reporters, as well as when using the Node API (Inside the linter-jscs Atom package).

image

Note that this was initially filed as https://github.com/AtomLinter/linter-jscs/issues/241.

A folder with a minimal reproduction case is included here: linter-jscs_GH241.zip

If there is any further information you need just let me know.

markelog commented 8 years ago

Same as https://github.com/jscs-dev/node-jscs/issues/2244

Arcanemagus commented 8 years ago

Really? Interesting, it doesn't show the same error in the output and the rules are entirely different so I assumed it was a different bug.

markelog commented 8 years ago

Yeah, different representation of the same thing, everything would work correctly with the -x flag aka enabled autofix though