question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add native line endings option to linebreak-style

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
not-an-aardvarkcommented, May 21, 2017

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.

1reaction
ljharbcommented, May 15, 2017

Gotcha. Certainly native would be a better choice than unix or windows 😃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I write a ESLint rule for "linebreak-style", changing ...
This option is preferable since it avoids all line ending changes to be recorded in the project's repository (version control). Not so optimal ......
Read more >
Add 'native' as well as 'windows' and 'unix' to linebreak-style
Yes, there are some other options, but that particular option is very widely used, and very helpful at avoiding line ending problems. All...
Read more >
linebreak-style - ESLint - Pluggable JavaScript Linter
This rule enforces consistent line endings independent of operating system, VCS, or editor used across your codebase. Options. This rule has a string...
Read more >
How to Get Consistent Line Breaks in vs Code (LF vs CRLF)
At the bottom right of the screen in VS Code, click the little button that says LF or CRLF .
Read more >
Configuring line separators - WebStorm - JetBrains
Click the widget and select another line separator style. Status of line separators · Alternatively, select another ending style in File | File ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found