A commitlint config that extends @commitlint/config-conventional
. Additionally enforces a body line length max of 72 characters.
npm install --save-dev husky @commitlint/{config-conventional,cli} @therealklanni/commitlint-config
In your commitlint.config.js
update the extends
field:
module.exports = {
extends: ['@therealklanni']
}
In your package.json
add your husky hook:
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}