forked from Seedsa/echo-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commitlint.config.js
89 lines (88 loc) · 1.88 KB
/
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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const typeEnum = {
feat: {
description: '新功能',
title: 'Features',
emoji: '✨',
},
fix: {
description: 'BUG修复',
title: 'Bug Fixes',
emoji: '🐛',
},
docs: {
description: '文档变更',
title: 'Documentation',
emoji: '📚',
},
style: {
description: '代码样式美化(不影响代码运行的变动)',
title: 'Styles',
emoji: '💎',
},
refactor: {
description: '代码重构',
title: 'Code Refactoring',
emoji: '📦',
},
perf: {
description: '性能优化',
title: 'Performance Improvements',
emoji: '🚀',
},
test: {
description: '测试',
title: 'Tests',
emoji: '🚨',
},
revert: {
description: '回退',
title: 'Reverts',
emoji: '🗑',
},
chore: {
description: '构建/工程依赖/工具',
title: 'Chores',
emoji: '🚀',
},
}
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', Object.keys(typeEnum)],
},
prompt: {
messages: {
skip: ':可选',
max: '最多 %d 个字符',
min: '最少 %d 个字符',
emptyWarning: '此项不能为空',
},
questions: {
type: {
description: '请选择提交类型',
enum: typeEnum,
},
scope: {
description: '请输入文件修改范围',
},
subject: {
description: '请简要描述提交',
},
body: {
description: '请输入详细描述',
},
isBreaking: {
description: '是否有任何重大变更?',
},
isIssueAffected: {
description: '此次变更是否影响打开的issues?',
},
issuesBody: {
description: '如果问题已解决,请输入解决的结果',
},
issues: {
description: '添加 issue 参考 (e.g. "fix #123", "re #123".)',
},
},
},
}