jscs-dev / node-jscs

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

Unexpected error with validateLineBreaks #2086

Closed gustafl closed 8 years ago

gustafl commented 8 years ago

I'm having a problem with the validateLineBreaks rule. The docs seem to contradict how the character option work. The docs says:

String specifies the line break character that is allowed. (Values allowed: "CR", "LF" or "CRLF")

I set it to "CRLF", because in my files lines end with CRLF. But I still get an error. If I set it to "LF", I get no error. See images below:

newline_error.png

jscsrc.png

hexview.png

markelog commented 8 years ago

There might be a lot of things that could affect it. Do you have .editorconfig/.gitattributes file? What mode enabled in sublime? You can see it with view -> line edings

gustafl commented 8 years ago

Thank you for the quick feedback. I have neither .editorconfig nor .gitattributes in my current project. The View > Line Endings setting is set to Windows. It makes no difference how I set it.

gustafl commented 8 years ago

Perhaps the error I get is due to a clash of rules in the .jscsrc file? I put the whole file here, in case it helps.

markelog commented 8 years ago

Sorry, can't reproduce, feel free to check out the code, we would welcome the pr, if error is indeed there