freenowtech / freenowtech/wave

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

Open
#392 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
67
Forks
31
Avg merge
1d 8h
Merged PRs (30d)
4

Description

### 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.