Closed MikeTheCanuck closed 6 years ago
The precommit
/ lint-staged
bit was just copy-pasted from the suggested lint-staged
+ Prettier docs. It lints/formats only staged files. The separate prettier
command formats everything which can be useful after updating Prettier or changing its config in some way.
The difference of js,jsx,json,css
vs js,jsx
is unintentional.
Aside: I'd be interested to understand in which contexts you're calling the
prettier
script outside of the git commit flow?
Just whenever I feel like it. No hidden secret here. Nothing to really read into. 😄
I'm intrigued by your use of precommit/staged-files linting - I'd like to implement that in my own project.
In my research to understand how the options work for this project, it appears you've configured
prettier
twice - once forprecommit
and again for its own script. However, there are different file types being applied depending on the context - is there a particular reason to leavejson,css
out of theprettier
script call, or just historical evolution?See line 33 of
package.json
:versus the
lint-staged
configuration at line 22 ofpackage.json
:Aside: I'd be interested to understand in which contexts you're calling the
prettier
script outside of the git commit flow? Is this something you do just occasionally or arbitrarily, or is the inclusion of aprettier
script an artifact of the initial inclusion ofprettier
in the project?