Skip to content

Pre commit hooks

Course: ESLint, Prettier and Pre-commit hooks - chapter 9

Ref - https://typicode.github.io/husky/

  • Install husky
npm install --save-dev husky
  • Initialise husky
npx husky init
  • Update .husky/pre-commit
npm prettier
  • Try to commit
git init
git add .
git commit -m "Init"

  • You can get past it by using --no-verify
git commit -m "init" --no-verify