-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommitlint.config.cjs
More file actions
59 lines (51 loc) · 1.26 KB
/
commitlint.config.cjs
File metadata and controls
59 lines (51 loc) · 1.26 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
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat',
'setting',
'chore',
'style',
'fix',
'hotfix',
'docs',
'refactor',
'test',
'design',
'build',
'deploy',
],
],
'subject-case': [0],
'header-max-length': [2, 'always', 100],
'header-issue-suffix': [2, 'always'],
},
plugins: [
{
rules: {
'header-issue-suffix': (parsed) => {
const { header } = parsed;
const issuePattern = /\(#\d+\)$/;
const typePattern =
/^(feat|setting|fix|chore|style|docs|refactor|test|design|build|deploy)/;
if (!typePattern.test(header)) {
return [
false,
'❌ 커밋 메시지는 feat, chore 등 올바른 타입을 포함해야 합니다.',
];
}
if (!issuePattern.test(header)) {
return [
false,
'❌ 커밋 메시지는 반드시 이슈 번호로 끝나야 합니다.',
];
}
return [true];
},
},
},
],
};