Why should I use core.autocrlf=true in Git?

The only specific reasons to set autocrlf to true are: avoid git status showing all your files as modified because of the automatic EOL conversion done when cloning a Unix-based EOL Git repo to a Windows one (see issue 83 for instance) and your coding tools somehow depends on a native EOL style being present in your file: for instance, a code generator hard-coded to detect native EOL … Read more

Expected linebreaks to be ‘LF’ but found ‘CRLF’ linebreak-style

Check if you have the linebreak-style rule configure as below either in your .eslintrc or in source code: Since you’re working on Windows, you may want to use this rule instead: Refer to the documentation of linebreak-style: When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that different line endings … Read more

How to read lines of a file in Ruby

153 I believe my answer covers your new concerns about handling any type of line endings since both “\r\n” and “\r” are converted to Linux standard “\n” before parsing the lines. To support the “\r” EOL character along with the regular “\n”, and “\r\n” from Windows, here’s what I would do: Of course this could be a bad idea on very large files since it means … Read more