-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommitlint.config.ts
43 lines (40 loc) · 1 KB
/
commitlint.config.ts
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
36
37
38
39
40
41
42
43
import type { UserConfig } from '@commitlint/types'
import { RuleConfigSeverity } from '@commitlint/types'
const acceptedTypes = [
'build',
'chore',
'ci',
'docs',
'feat',
'feature',
'fix',
'bugfix',
'opt',
'merge',
'perf',
'refactor',
'revert',
'style',
'test'
]
const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [RuleConfigSeverity.Error, 'always', acceptedTypes],
'type-case': [RuleConfigSeverity.Error, 'always', 'lower-case'],
'subject-case': [
RuleConfigSeverity.Error,
'always',
['sentence-case', 'start-case', 'pascal-case', 'upper-case', 'lower-case']
]
},
helpUrl: '\n\thttps://commitlint.js.org/\n\thttps://github.com/conventional-changelog/commitlint/#what-is-commitlint',
ignores: [
(commit) => {
const mergeReg = /^Merge branch '(.*?)' into '(.*?)'$/
const match = commit.match(mergeReg)
return match ? true : false
}
]
}
module.exports = Configuration