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

Prettier does not respect .prettierignore when running in the precommit hook #392

Open
martimalek opened this issue Oct 30, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@martimalek
Copy link
Contributor

martimalek commented Oct 30, 2023

Relevant code

When running git commit the prettier script runs due to the precommit hook. This executes pretty-quick --staged, which basically runs prettier against all staged files. The issue is that it does not take into account the .prettierignore file.

What was expected to happen?

When running prettier the .prettierignore file should be respected

Reproduction

  • Go to the next branch
  • Change anything in src/codemods/__testfixtures__/block-to-width-100.output.tsx (e.g. add a random comment in one file)
  • Run git add on what you changed
  • Try to commit

It will create a commit but it will have run prettier against the file that you changed, even though we are supposed to ignore it thanks to our .prettierignore file

@martimalek martimalek added the bug Something isn't working label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant