Git Hooks with Husky
If you followed along with Chapter 2, Integrated Tooling with VS Code, you’ve adopted a cutting-edge development setup, completed with integrated linting and auto-formatting. However, your collaborators might not be so prepared. There’s nothing stopping them from submitting a pull request that violates your project’s prescribed ESLint or stylelint rules, or which will transform when you run it through Prettier. How can you enforce those rules? You could add checks to Travis CI, but then someone still has to fix the problems. Ideally, whoever introduced the problems should fix them before pushing their branch up for everyone else to see.
That’s where Husky comes in. Husky is a tool for managing Git hooks in JavaScript ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access