🔸 install npm install husky --save-dev
🔸 enable Git hooks npx husky install
🔸 to automatically have Git hooks enabled after install npm pkg set scripts.prepare="husky install"
🔸 package.json
:
{
"scripts": {
"prepare": "husky install"
}
}
🔸 npx husky add .husky/pre-commit "npm test"
🔸 git add .husky/pre-commit
🔸 git commit -m "Keep calm and commit"