1.2.0 • Published 3 years ago
@dlwlrma/commitlint-config v1.2.0
Commitlint Config Preset
Installation
yarn add @dlwlrma/commitlint-config --D
After installation create a file commitlint.config.js
at project root and extend the config:
{
"extends": ["@dlwlrma/commitlint-config"],
"rules": {}
}
Usage
Example for enforce ticket reference at commit message body
{
"extends": ["@dlwlrma/commitlint-config"],
"rules": {
"ticket-rule": [2, "always", ["TICKET-"]]
}
}
Simply read the commitlint documentation and follow those instructions.
Git Hook
Setup pre-commit hook for linting commit message.
yarn add husky --D
npm install husky --save-dev
Update package.json
"husky": {
"hooks": {
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
}
}