Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .gitattributes file to compensate for .editorconfig end_of_line on Windows #39

Open
segevfiner opened this issue Nov 12, 2024 · 0 comments

Comments

@segevfiner
Copy link

segevfiner commented Nov 12, 2024

Please describe

By setting end_of_line = lf in .editorconfig, the editor and prettier will write lf line endings, but Git on Windows is often configured with core.autccrlf=true which will check out the files with crlf line endings. To compensate for that, the repository needs to include a .gitattributes with *.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue} text eol=lf (Or otherwise if that glob syntax is not supported in gitattributes) or maybe just * text=auto eol=lf as recommended by prettier? .

Additional context

https://git-scm.com/docs/gitattributes#_checking_out_and_checking_in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant