Universal Commitlint configuration.
pnpm add -D @commitlint/cli @commitlint/config-conventional cz-git commitizen @bit-ocean/commitlint-config
Create a .commitlintrc.json
file in the root of your project and add the following:
{
"extends": ["@bit-ocean"]
}
Then add the following properties to your package.json
:
{
"scripts": {
"cz": "git-cz"
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
}
}
Run following command to add husky
and a commit-msg
hook:
pnpm add -D husky
pnpm i
npx husky init
echo 'npx --no -- commitlint --edit "$1"' > .husky/commit-msg
Run the following command to commit your changes:
git add .
pnpm cz
MIT License © 2024 Bit Ocean