Clean and format your code before committing with Husky 🐶

Unsplash: Cody Board
  • commit-msg
  • post-commit
  • post-merge
  • pre-push
  • And more

Setup

Husky is a simple npm package, so we can install it very easily:

yarn add -D husky
package.json

Usage

There is no special action to do. Your hooks will be triggered when doing the provided actions. Such as:

git commit -m "Trigger pre-commit hook 🤓"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store