-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make Prettier preserve line ending type #2244
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
Unrelatedly it'd be nice to have our prettier config in a .prettierrc
file instead of just in the precommit configuration.
side note:
uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh 😆 |
Thanks! It seems that some Mac build is failing, but it's the same as on I'll add the |
Hmm, the symlinks still toggle, but there you go with the config file at least! I'm happy for now. It's not like running pre-commit manually is absolutely necessary or anything. |
Thanks much for your contribution! This project is only possible by contributions like these 🖤. You're awesome, @felix-hilden. To be honest, I haven't touched a Windows machine in a long time so I've never seen this as an issue nervous laughter. Also, I've started a new project to improve the contributing experience for this project, so I'd love to hear your feedback and suggestions. More details can be found here: GH-2238. don't mind me testing out this new manner of saying thanks haha :D |
You're most welcome! Yeah I think that's a very nice thank you for any new contributor, albeit a little over the top for my modest Finnish self :D but I know that won't read so sarcastic for other potential contributors 😅 Also, that black heart is a nice touch. Hmm, I'll have a look at the issue! |
Hi! This PR, should you choose to accept it, makes Prettier preserve the line ending types of files it touches.
Why? The default in Prettier 2.0 was changed from
auto
toLF
. This makes development on Windows awkward, because every file is marked with changes both by Prettier and then by Git regardless of repository line ending settings, making committing harder than it should be.As discussed in #1741, line ending settings can be configured, and there are other tools for enforcing line ending consistency. I don't know whether they have the same effect of converting all files regardless of settings though.
Suggested:
skip-news
. If this is not to your liking, feel free to close. This PR will self-destruct in five years.Aside from that: I noticed that runnin pre-commit manually seems to add line endings to symlink files, but they disappear when actually committing. Don't know if that's a known.. quirk..(?) or not.