Sublime Forum

Sublime Linter ESLINT/JSCS falsy detect lineending as unix

#1

Hallo Folks!
Please help me with this.
Cheers Robin

OS: Win7
Sublime Build: 3126 (had this problem with previous versions as well)
Sublime Linter Version: 3

I’ve tried ESLint and JSCS.

With following rules:

"linebreak-style": [
      error,
      "windows"
    ],
and respektivly:

"validateLineBreaks": "CRLF",

Both falsely detect line breaks in Sublime as Unix.

Console (on every Line):
SublimeLinter: eslint output:
D:\Dev\lgv\js\app.js: line 1, col 11, Error - Expected linebreaks to be ‘CRLF’ but found ‘LF’. (linebreak-style)

I’ve set "“show_line_endings”: true and it correctly shows “windows”, Notepad++ also shows Lineendings to be CRLF (see attached Screenshot)

0 Likes

#2

depending how these linters work, it could be because ST normalizes all line endings to LF when it reads a file into memory, to make life easier for plugins etc. and ensures it saves them with the chosen lineendings. So if the linters are checking ST’s representation, then it will always see LF/Unix style.

0 Likes

#3

Ok, thanks for your reply!

0 Likes