-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.cjs
More file actions
36 lines (36 loc) · 1.13 KB
/
commitlint.config.cjs
File metadata and controls
36 lines (36 loc) · 1.13 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
// https://commitlint.js.org/
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
// type 必须是以下之一
'type-enum': [
2,
'always',
[
'feat', // 新功能
'fix', // Bug 修复
'docs', // 文档变更
'style', // 代码格式(不影响逻辑)
'refactor', // 重构
'perf', // 性能优化
'test', // 测试
'build', // 构建系统/工具链
'ci', // CI 配置
'chore', // 其他杂项
'revert', // 回滚
'widget', // Widget 开发(自定义)
],
],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'subject-max-length': [2, 'always', 100],
// scope 不强制但如果写了要小写
'scope-case': [2, 'always', 'lower-case'],
// header 总长不超过 120
'header-max-length': [2, 'always', 120],
// body 不强制行长(VS Code / AI 生成的描述往往较长)
'body-max-line-length': [0],
},
};