Repository navigation
Expand file tree
/
Copy pathcommitlint.config.ts
More file actions
72 lines (68 loc) · 1.81 KB
/
Copy pathcommitlint.config.ts
File metadata and controls
72 lines (68 loc) · 1.81 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import type { UserConfig } from '@commitlint/types'
import { RuleConfigSeverity } from '@commitlint/types'
import fg from 'fast-glob'
function getPackages(packagePath: string) {
return fg.sync('*', { cwd: packagePath, onlyDirectories: true })
}
const scopes = [
...getPackages('src'),
]
const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [RuleConfigSeverity.Warning, 'always'],
/**
* type[scope]: [function] description
*
* - something here
*
* ^^^^^^^^^^^^^^
*/
'footer-leading-blank': [RuleConfigSeverity.Warning, 'always'],
/**
* type[scope]: [function] description [No more than 72 characters]
* ^^^^^
*/
'header-max-length': [RuleConfigSeverity.Error, 'always', 72],
'subject-case': [
1,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
],
'subject-empty': [RuleConfigSeverity.Error, 'never'],
'subject-full-stop': [RuleConfigSeverity.Error, 'never', '.'],
'type-case': [RuleConfigSeverity.Error, 'always', 'lower-case'],
'type-empty': [RuleConfigSeverity.Error, 'never'],
/**
* type[scope]: [function] description
* ^^^^
*/
'type-enum': [
RuleConfigSeverity.Error,
'always',
[
'build',
'chore',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'release',
'style',
'test',
'improvement',
],
],
'scope-enum': [RuleConfigSeverity.Error, 'always', scopes],
/**
* type[scope]: [function] description
*
* ^^^^^^^^^^^^^^ empty line.
* - Something here
*/
'scope-case': [RuleConfigSeverity.Error, 'always', 'lower-case'],
},
}
export default Configuration