Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Darkborderman/8216a399e62763beaf1e3c0f155fc7cf to your computer and use it in GitHub Desktop.
Save Darkborderman/8216a399e62763beaf1e3c0f155fc7cf to your computer and use it in GitHub Desktop.
Change End of Line Sequence from CRLF to LF to all files in the project for supporting ESLint

Converting the End of Line Sequence from CRLF to LF in any of your project files

Execute the following commands in your root of your project folder

NOTE: Do not do the following steps without commiting your data. As it clears all the git cache and it will clear all your changes in your project.

  1. First disable the autoCRLF in the git config by running the following command in your terminal git config core.autocrlf false

  2. Then remove the cached files in the git. Run the following command: git rm --cached -r .

  3. Then reset the project files by executing the following command to complete conversion. git reset --hard

That's it now all the files that have CRLF will be converted to LF.

Additionally you can add "files.eol": "\n" in your Vscode settings.

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