Install Husky from https://typicode.github.io/husky/get-started.html
yarn add --dev husky
# Add pinst ONLY if your package is not private
yarn add --dev pinst
In the wp-content/themes/your-theme/.husky
folder add a file called pre-commit
. Inside pre-commit type: