Install your custom pre-commit Node.js script
npm i -D pre-commit.js
It automatically sets pre-commit
hook after installation.
Check .git/hooks/pre-commit
to sure.
Then put the path of your desired script in preCommitScript
field in your "package.json" file.
Currently, only Node.js scripts are acceptable. Bun.js support is on the agenda.
Good to know!
You can also manually set it up using:
npx init-pre-commit-hookafter installation (
npm install
).