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.

Feature request: operating system specific line endings

See original GitHub issue

Hi,

In the current version of prettier there is an option to force line endings to “crlf” or “lf” (default is “auto” which means to detect the type of the first line ending):

endOfLine: "<auto|lf|crlf|cr>"

I think it would be a good idea to add a new setting for this option, which works like “crlf” on windows and like “lf” on linux so that line endings are changed to what is usual for the os used (similar to git, which uses “lf” on linux when checking out and “crlf” on windows per default).

What do you think about this feature request?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
lydellcommented, Nov 22, 2018

What’s your use case?

1reaction
kachkaevcommented, Nov 23, 2018

@mhinterreither Windows folks who switch from CRLF to LF might need to re-check out all files after you’ve set * text=auto eol=lf. This is to ensure that there are no CRLF files in the working directory.

You may also want to search for \r in the repo a few times during the transition period to ensure that no CRLFs slip through. As an extra precaution, feel free to create .editorconfig file and .vscode/settings.json to help editors pick LF when creating new files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the strategy for handling CRLF (carriage return, line ...
Git allows you to set the line ending properties for a repo directly using the text attribute in the .gitattributes file.
Read more >
You're just another carriage return line feed in the wall
This ensures that all files that git considers to be text will have normalized (LF) line endings in the repository.
Read more >
Line Breaks in Windows, UNIX and Macintosh Text Files
Line Breaks in Windows, UNIX & Macintosh Text Files​​ Windows, and DOS before it, uses a pair of CR and LF characters to...
Read more >
How to Get Consistent Line Breaks in vs Code (LF vs CRLF)
This is typically due to a difference in line endings, especially the difference in LF vs. CRLF . Unix systems like Linux and...
Read more >
The Secret World of Newline Characters - Enigma | Data
A newline is LF on Unix. Operating systems using CR LF include CP/M, DOS, OS/2 and Windows. Naturally, this caused an incompatibility. To...
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