A commitlint rule for conditionally requiring references in commit messages for given types.
yarn
yarn add --dev @episerver/commitlint-plugin-referencesnpm
npm install --save-dev @episerver/commitlint-plugin-referencesTo configure that references should never be empty for fix and feat. It is also possible to specify the issue prefix in parserPreset, the default value is #.
module.exports = {
plugins: [
"@episerver/references"
],
rules: {
"references-empty-enum": [
2,
"never",
[
"fix",
"feat"
]
]
},
parserPreset: {
parserOpts: {
issuePrefixes: ["ABC-"]
}
}
};