Skip to content

Instantly share code, notes, and snippets.

@tjsudarsan
Last active May 16, 2024 07:40
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.

@3gi-anita
Copy link

csdsa

@eugenioxcastro
Copy link

Thanks! Totally Worked

@Binghagoon
Copy link

Thanks!!!

@Hugodlf
Copy link

Hugodlf commented Jul 11, 2023

THANK YOU BRO

@andreycmartins
Copy link

ty

@adamwojszczyk
Copy link

Thanks

@witchbl4dess
Copy link

ty

@Its-Haze
Copy link

Nice, thanks!

@sakshamchhimwal
Copy link

nice

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