@forsakringskassan/commitlint-config
v4.2.5
Published
FK commitlint shareable config
Keywords
Readme
@forsakringskassan/commitlint-config
Based on Conventional Commits with additional checks for JIRA.
[optional scope]: ()
[optional body]
[optional footer(s)]
fix:fixes a bug and results in aPATCHrelease.feat:introduces a new feature and results in aMINORrelease.BREAKING CHANGE:in the footer followed by a description results in aMAJORrelease. The description is added to the changelog.typesother thanfixandfeatis allowed, see list at @commitlint/config-conventional(fixes XYZ-123)or(refs XYZ-123)JIRA reference must be included after subject.
Install
$ npm install --save-dev @forsakringskassan/commitlint-configThis package bundles @commitlint/cli so it does not have to be installed separately.
Configuration
This package provides two variants:
@forsakringskassan/commitlint-config/default@forsakringskassan/commitlint-config/no-jira
The default configuration enforces a JIRA reference at the end of the header.
The no-jira variant does not enforce it.
npm pkg set commitlint.extends=@forsakringskassan/commitlint-config/defaultor manually edit package.json:
{
"commitlint": {
"extends": "@forsakringskassan/commitlint-config/default"
}
}Adding hooks
This package also provides the following git hooks:
- Prettier and Esbuild will run before a commit is created (if the packages exist in your application).
- The commit message will be validated.
To validate commit messages as commits are created, you also need to set up the Git hooks.
$ npm pkg set scripts.prepare="commitlint-config"or manually edit your package.json
{
"scripts": {
"prepare": "commitlint-config"
}
}Before installing this plugin
If you already have husky, simple-git-hooks or lint-staged in your package.json you need uninstall them first:
npm rm lint-staged husky simple-git-hooksDebug mode
You can add --debug when calling commitlint-config in order to get debug information which could be useful when troubleshooting.
