-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
28 lines (27 loc) · 1.16 KB
/
commitlint.config.js
File metadata and controls
28 lines (27 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// eslint-disable-next-line @typescript-eslint/no-var-requires
const czConfig = require('./.cz-config.js');
const { TICKET_PATTERNS } = require('@justeattakeaway/pie-monorepo-utils/git-hooks/git-hooks-utils.js');
module.exports = {
extends: ['@commitlint/config-conventional'],
plugins: [
{
rules: require('@justeattakeaway/pie-monorepo-utils/commitlint-plugin/index.js').rules
}
],
rules: {
'type-enum': [2, 'always', czConfig.types.map((t) => t.value)],
'scope-enum': [2, 'always', czConfig.scopes],
'match-pie-commit-pattern': [2, 'always'],
// Disable built-in rules that conflict with our custom validation
'type-empty': [0, 'never'],
'subject-empty': [0, 'never'],
'references-empty': [0, 'never'],
},
parserPreset: {
parserOpts: {
headerPattern: TICKET_PATTERNS.COMMIT,
headerCorrespondence: ['type', 'scope', 'ticket', 'subject'],
referenceActions: null, // this stops commitlint erroring when using these words ['close', 'closes', 'closed', 'fix', 'fixes', 'fixed', 'resolve', 'resolves', 'resolved']
},
},
};