-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommitlint.config.ts
More file actions
49 lines (40 loc) · 1.21 KB
/
commitlint.config.ts
File metadata and controls
49 lines (40 loc) · 1.21 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
import type { UserConfig, Rule } from '@commitlint/types';
const footerIssueRequired: Rule = (parsed) => {
const header = parsed.header ?? '';
const hasIssue = /\(#\d+\)/.test(header);
return hasIssue
? [true]
: [false, '커밋 메시지에 이슈 번호 (#번호) 를 포함해야 합니다.'];
};
const config: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
// 타입은 소문자만 허용
'type-case': [2, 'always', 'lower-case'],
// type 강제 목록 설정
'type-enum': [
2,
'always',
['feat', 'fix', 'docs', 'refactor', 'style', 'test', 'chore', 'init'],
],
// 타입, 메시지 필수
'type-empty': [2, 'never'],
'subject-empty': [2, 'never'],
// 제목은 마침표로 끝나지 않게
'subject-full-stop': [2, 'never', '.'],
// 제목 길이는 100자 이내 권장
'header-max-length': [2, 'always', 50],
// 커밋 메시지에 (#숫자) 필수 ➡️ 커스텀 룰
'footer-issue-required': [2, 'always'],
// 대문자 포함 가능
'subject-case': [0],
},
plugins: [
{
rules: {
'footer-issue-required': footerIssueRequired,
},
},
],
};
export default config;