Prettier pre-commit hook
See original GitHub issueNow that we’re using prettier to keep our formatting consistent, is there interest in a pre-commit hook to ensure all commits are Prettified? I’ve had great success with this in my day job, but I’m not sure how common this is on large open-source projects.
If this is something we want, which direction would we want to go in? There are a few options on the Prettier docs. I’ve always used the lint-staged
with husky
solution, but I’d like to hear thoughts on this.
I’m happy to pick this up myself if we want it implemented.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Pre-commit Hook - Prettier
Pre-commit Hook ... You can use Prettier with a pre-commit tool. This can re-format your files that are marked as “staged” via git...
Read more >Setting up Prettier and ESLint with pre-commit hook · GitHub
Setting up Prettier and ESLint with pre-commit hook · Initialize Git repository. git init · Create .gitignore file and add the following: ·...
Read more >Using Prettier with Git Hooks for Formatting Consistency
By setting up a pre-commit Git Hook, we can run the Prettier command and ensure formatting consistency for all the developers working on...
Read more >Configure Pre-commit Hook Prettier in your React Application ...
Prettier is a code formatted compatible with languages such as JavaScript, HTML, CSS, YAML, Markdown and GraphQL, and a lot more. It's also ......
Read more >Pre-Commit hooks! (eg prettier) - Ahmedtoyib
A Pre-commit hook is run just before a commit is added to a new revision. They are mainly used to point out issues...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes yes yes yes! Let’s go
lint-staged
withhusky
.@lukebelliveau
I do not think we should run either prettier or eslint on the
flow-typed/
folderI’ve left comments on your PR; actually the opposite will lead to problems. The plugin runs prettier after all other rules and the configs disable conflicting rules. so it actually works better together using the config + plugin