-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
83 lines (83 loc) · 4.14 KB
/
commitlint.config.js
File metadata and controls
83 lines (83 loc) · 4.14 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/** @type {import('czg').UserConfig} */
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat', 'fix', 'hotfix', 'docs', 'style', 'refactor', 'perf',
'test', 'build', 'ci', 'chore', 'revert',
'init', 'wip', 'release', 'security', 'deps', 'ui', 'i18n',
'types', 'rm', 'mv',
],
],
'subject-max-length': [2, 'always', 100],
},
prompt: {
alias: { fd: 'docs: fix typos' },
messages: {
type: '选择提交类型:',
scope: '选择影响范围(可选,回车跳过):',
customScope: '自定义范围:',
subject: '填写简短描述:\n',
body: '填写详细描述(可选,回车跳过):\n',
footer: '关联 Issues(可选,如 #31, #I3244):\n',
confirmCommit: '确认提交以上信息?',
},
types: [
{ value: 'feat', name: 'feat: ✨ 引入新功能', emoji: '✨' },
{ value: 'fix', name: 'fix: 🐛 修复 Bug', emoji: '🐛' },
{ value: 'hotfix', name: 'hotfix: 🚑️ 紧急修复', emoji: '🚑️' },
{ value: 'docs', name: 'docs: 📝 文档新增或更新', emoji: '📝' },
{ value: 'style', name: 'style: 🎨 改善代码结构/格式', emoji: '🎨' },
{ value: 'ui', name: 'ui: 💄 UI 界面/样式更新', emoji: '💄' },
{ value: 'refactor', name: 'refactor: ♻️ 代码重构', emoji: '♻️' },
{ value: 'perf', name: 'perf: ⚡️ 性能优化', emoji: '⚡️' },
{ value: 'test', name: 'test: ✅ 测试新增或更新', emoji: '✅' },
{ value: 'build', name: 'build: 📦️ 构建产物/依赖包更新', emoji: '📦️' },
{ value: 'ci', name: 'ci: 👷 CI 构建系统新增或更新', emoji: '👷' },
{ value: 'chore', name: 'chore: 🔧 配置文件新增或更新', emoji: '🔧' },
{ value: 'revert', name: 'revert: ⏪️ 回退提交', emoji: '⏪️' },
{ value: 'init', name: 'init: 🎉 初始化项目', emoji: '🎉' },
{ value: 'wip', name: 'wip: 🚧 进行中(WIP)', emoji: '🚧' },
{ value: 'release', name: 'release: 🔖 发布版本/版本标签', emoji: '🔖' },
{ value: 'security', name: 'security: 🔒️ 修复安全/隐私问题', emoji: '🔒️' },
{ value: 'deps', name: 'deps: ⬆️ 升级依赖', emoji: '⬆️' },
{ value: 'i18n', name: 'i18n: 🌐 国际化与本地化', emoji: '🌐' },
{ value: 'types', name: 'types: 🏷️ 新增或更新类型', emoji: '🏷️' },
{ value: 'rm', name: 'rm: 🔥 删除代码或文件', emoji: '🔥' },
{ value: 'mv', name: 'mv: 🚚 移动或重命名文件/路径', emoji: '🚚' },
],
useEmoji: true,
emojiAlign: 'center',
themeColorCode: '',
scopes: [],
allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: 'bottom',
customScopesAlias: 'custom',
emptyScopesAlias: 'empty',
upperCaseSubject: false,
markBreakingChangeMode: false,
allowBreakingChanges: ['feat', 'fix', 'hotfix'],
breaklineNumber: 100,
breaklineChar: '|',
skipQuestions: [],
issuePrefixes: [{ value: 'closes', name: 'closes: ISSUES 已关闭' }],
customIssuePrefixAlign: 'top',
emptyIssuePrefixAlias: 'skip',
customIssuePrefixAlias: 'custom',
allowCustomIssuePrefix: true,
allowEmptyIssuePrefix: true,
confirmColorize: true,
maxHeaderLength: Infinity,
maxSubjectLength: Infinity,
minSubjectLength: 0,
scopeOverrides: undefined,
defaultBody: '',
defaultIssues: '',
defaultScope: '',
defaultSubject: '',
},
}