Feature request: operating system specific line endings
See original GitHub issueHi,
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:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What’s your use case?
@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.