-
Notifications
You must be signed in to change notification settings - Fork 1
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
prettier:write complains about package.json when saved from Windows #21
Comments
an workaround would be to add this to .gitattributes:
|
This is to ensure git will always converts to line feed endings. This should help with #21
@3esmit Here's a PR that enforces line feeds in the git repository: #26 Following the recommendations by prettier:
With this we're checking off 1), 3) and 4). I'll look into setting up the commit hook next. |
So git hooks are client-side (local) only. https://prettier.io/docs/en/precommit You might want to try this on top of #26 also |
This is to ensure git will always converts to line feed endings. This should help with #21
@3esmit how do we move forward here. Did you try any of the options? |
I am not sure. I have tried some but didnt seemed to work. It's difficult to diagnose this. |
Did you try installing a pre-commit hook? |
Closing this due to inactivity |
I am using WSL with Ubuntu. My console is Linux, but my editor is Windows.
When I edit package.json, I can run normally everything here, 'pnpm lint' or whatever. However, when I send to repository, CI lint complains about package.json having style issues.
When we see the diff, nothing changes, besides the last line of the code that is changed in an invisible character.
To workaround this, I open the file in a console editor inside WSL, and than save it.
I think this is a bug or configuration on prettier itself, as it should not matter what EOL are used, as Windows is able to interpret Linux files, and Linux is able to interpret Windows file.
It shouldn't warn for Windows EOL, unless there is a good reason for that.
The text was updated successfully, but these errors were encountered: