-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
33 lines (32 loc) · 1019 Bytes
/
commitlint.config.js
File metadata and controls
33 lines (32 loc) · 1019 Bytes
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
module.exports = {
// default commit convention 활성화
// extends: ["@commitlint/config-conventional"],
rules: {
'type-convention': [2, 'always'],
// 'body-max-line-length': [2, 'always', 72],
},
plugins: [
{
rules: {
'type-convention': ({ header }) => {
const typeRegex = /^.{2}(feat|fix|style|refactor|cleanup|chore|test)/
const isTypeMatch = header.includes(':')
? typeRegex.test(header.split(':')[0])
: false
return [
isTypeMatch,
`올바른 타입 컨벤션이 아닙니다.
규칙 : {gitmoji}{commit-type}\ : {title}
ex) 🎨fix : 라벨 삽입코드추가, 리드미 작성`,
]
},
'body-max-line-length': ({ body }) => {
console.log(body)
console.log(body.length)
const isBodyMatch = body && body.length <= 72
return [!body, isBodyMatch, '본문은 72자 이하로 작성해주세요']
},
},
},
],
}