@void0/commitlint-config
v1.3.0
Published
Shareable commitlint config adding content and design to conventional commits
Downloads
1
Maintainers
Readme
@void0/commitlint-config
Shareable commitlint
config enforcing conventional commits.
Getting started
npm install --save-dev @void0/commitlint-config @commitlint/cli husky
echo "module.exports = {extends: ['@void0/commitlint-config']};" > commitlint.config.js
// package.json
{
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
Rules
type-enum
condition:
type
is found in valuerule:
always
value
[ "build", "chore", "ci", "content", "design", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test" ]
You will find more information about the types, how to use them and how to create corresponding Github labels in docs/types.
echo "foo: some message" # fails
echo "fix: some message" # passes
type-case
- description:
type
is in casevalue
- rule:
always
- value
'lowerCase'
echo "FIX: some message" # fails
echo "fix: some message" # passes
type-empty
- condition:
type
is empty - rule:
never
echo ": some message" # fails
echo "fix: some message" # passes
scope-case
- condition:
scope
is in casevalue
- rule:
always
'lowerCase'
echo "fix(SCOPE): some message" # fails
echo "fix(scope): some message" # passes
subject-case
- condition:
subject
is in one of the cases['sentence-case', 'start-case', 'pascal-case', 'upper-case']
- rule:
never
echo "fix(SCOPE): Some message" # fails
echo "fix(SCOPE): Some Message" # fails
echo "fix(SCOPE): SomeMessage" # fails
echo "fix(SCOPE): SOMEMESSAGE" # fails
echo "fix(scope): some message" # passes
echo "fix(scope): some Message" # passes
subject-empty
- condition:
subject
is empty - rule:
never
echo "fix:" # fails
echo "fix: some message" # passes
subject-full-stop
- condition:
subject
ends withvalue
- rule:
never
- value
'.'
echo "fix: some message." # fails
echo "fix: some message" # passes
header-max-length
- condition:
header
hasvalue
or less characters - rule:
always
- value
72
echo "fix: some message that is way too long and breaks the line max-length by several characters" # fails
echo "fix: some message" # passes