Skip to content

Instantly share code, notes, and snippets.

@tjsudarsan
Last active May 24, 2024 08:24
Show Gist options
  • Save tjsudarsan/f2bfe4c4d567243e302cf8ba40e1c7e5 to your computer and use it in GitHub Desktop.
Save tjsudarsan/f2bfe4c4d567243e302cf8ba40e1c7e5 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.

@Its-Haze
Copy link

Nice, thanks!

@sakshamchhimwal
Copy link

nice

@tomtechservice
Copy link

Awesome.

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