forked from boostcampwm-2024/refactor-web05-Denamu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommitlint.config.js
44 lines (43 loc) · 918 Bytes
/
commitlint.config.js
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
// commitlint.config.js
module.exports = {
parserPreset: {
parserOpts: {
headerPattern: /^(\S+)\s\[(\w+)\]:\s(.+)$/u,
headerCorrespondence: ["emoji", "type", "subject"],
},
},
rules: {
"header-pattern": [2, "always"],
"type-enum": [
2,
"always",
[
"feat",
"fix",
"refactor",
"perf",
"style",
"docs",
"test",
"chore",
"clean",
],
],
},
plugins: [
{
rules: {
"header-pattern": ({ header }, when = "always") => {
const regex = /^(\S+)\s(\w+):\s(.+)$/u;
const pass = regex.test(header);
return [
pass,
`커밋 메시지는 다음 형식을 따라야 합니다:\n` +
`[이모지] [타입]: [설명]\n` +
`예: ✨ feat: 기능 설명`,
];
},
},
},
],
};