Skip to content

Instantly share code, notes, and snippets.

@RadValentin
Created March 4, 2017 15:19
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RadValentin/dd8b9d70448413301e9a274ed54661a5 to your computer and use it in GitHub Desktop.
Save RadValentin/dd8b9d70448413301e9a274ed54661a5 to your computer and use it in GitHub Desktop.
How to stop ESLint/XO CRLF linebreak-style warnings in Windows

If you clone a git repo that enforces a linebreak-style: unix on a Windows machine then ESLint will probably throw the warning below even if you've made no local changes.

Expected linebreaks to be LF but found CRLF.  linebreak-style

In order to fix this you'll need to tell git to default to Unix style line endings rather that OS defaults.

git config --global core.eol lf
git config --global core.autocrlf input

Finally remember to save your work and then reset the repo so the new line endings get applied.

git rm -rf --cached .
git reset HEAD --hard
@dekdekbaloo
Copy link

Thank you! Saved me a lot of trouble :)

@qluqua
Copy link

qluqua commented Jul 12, 2019

it works! :)

@AakashRamavat
Copy link

Worked! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment