Add native line endings option to linebreak-style
See original GitHub issueThe linebreak-style rule is nice in that it ensures all linebreaks are the same. I consider that to always be appropriate.
However, its only available options currently are unix
and windows
. Thus, using this rule assumes a singular type of development environment. Neither option is appropriate on all platforms.
In every project I am a part of, we rely upon git to automatically convert the line endings when reading and writing between the object database and the working directory. I want CRLF on Windows and LF on UNIX-y systems and git handles this for us. But because of the linebreak-style
rule, I cannot make eslint
pass successfully on every platform, even when things are working as intended. ESLint outputs an error for every line in the project, making the experience pretty unusable for someone (by default, Windows developers).
I would like to see a native
option added, which would respect the os.EOL
constant. This would work extremely well with git’s defaults and improve the linting experience for Windows developers.
Here is how I solved it in user land: https://github.com/sholladay/eslint-config-tidy/commit/ffe762fedc3d3dbb2f86e75ef88bd72a8694047f
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Closing this issue because there were four 👎s from team members on the associated PR (https://github.com/eslint/eslint/issues/8620), so I think it’s safe to say that the team is not in favor of this proposal.
Gotcha. Certainly
native
would be a better choice thanunix
orwindows
😃.