-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.commitlintrc.cjs
More file actions
35 lines (29 loc) · 1017 Bytes
/
.commitlintrc.cjs
File metadata and controls
35 lines (29 loc) · 1017 Bytes
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
29
30
31
32
33
34
35
const TYPES = '(feat|fix|refactor|test|build|ci|docs|perf)';
const headerPattern = new RegExp(
String.raw`^(?:\[[A-Z]+-\d+\]\s)?${TYPES}:\s[a-z][^.]*$`
);
module.exports = {
extends: ['@commitlint/config-conventional'],
parserPreset: {
parserOpts: {
headerPattern: /^(\[[A-Z]+-\d+]\s)?(\w*)(?:\((.*)\))?: (.*)$/,
headerCorrespondence: ['jira', 'type', 'scope', 'subject'],
},
},
rules: {
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
['feat', 'fix', 'refactor', 'test', 'build', 'ci', 'docs', 'perf'],
],
'subject-empty': [2, 'never'],
'subject-case': [2, 'never', []],
'subject-full-stop': [2, 'never', '.'],
'scope-case': [2, 'never', []],
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', 100],
'footer-leading-blank': [1, 'always'],
'footer-max-line-length': [2, 'always', 100]
},
};