Commit 9ad2359
committed
fix: scope the fix-prettier npm script to its arguments
`fix-prettier` was defined as `prettier --write "projects/**/*.*"`,
so the glob was hardcoded into the script. lefthook's pre-push hook
calls `npm run fix-prettier {staged_files}` expecting the staged files
to be the target, but npm appends those arguments AFTER the existing
glob — meaning prettier formatted every file under `projects/**/*.*`
on every push, regardless of what was actually staged. A push touching
a single test file could leave the working tree with ~200 unrelated
modifications.
Drop the hardcoded glob so the script only formats the files passed
to it. lefthook can now do its `{staged_files}` substitution as
intended, and a push that touches three files runs prettier on three
files.
For manual full-project formatting, use `npx prettier --write "projects/**/*.*"` directly.1 parent fac26b0 commit 9ad2359
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments