Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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

This comment has been minimized.

Copy link

@dekdekbaloo dekdekbaloo commented Jul 5, 2018

Thank you! Saved me a lot of trouble :)


This comment has been minimized.

Copy link

@qluqua qluqua commented Jul 12, 2019

it works! :)


This comment has been minimized.

Copy link

@AakashRamavat AakashRamavat commented May 9, 2021

Worked! Thanks

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