Skip to content

Commit f294fe9

Browse files
committed
chore(commitlint): 新增校验规则 (#780)
新增 commitlint 校验规则为: 1. scope 不允许为空 2. scope 使用 lower-case 和 pascal-case 风格 3. 配置 scope-enum,防止出现奇怪的 scope
1 parent 7a38e3d commit f294fe9

File tree

2 files changed

+67
-5
lines changed

2 files changed

+67
-5
lines changed

commitlint.config.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
module.exports = {
2+
extends: [
3+
'@commitlint/config-conventional'
4+
],
5+
rules: {
6+
'scope-empty': [2, 'never'],
7+
'scope-case': [2, 'always', ['lower-case', 'pascal-case']],
8+
'scope-enum': [
9+
2,
10+
'always',
11+
[
12+
'EsLint',
13+
'VuePress',
14+
'package.json',
15+
'README',
16+
'.editorconfig',
17+
'.gitignore',
18+
'commitlint',
19+
'Example',
20+
'Button',
21+
'Icon',
22+
'Transition',
23+
'List',
24+
'Grid',
25+
'Card',
26+
'WaterFlow',
27+
'Album',
28+
'Sticky',
29+
'Collapse',
30+
'Avatar',
31+
'Badge',
32+
'Countdown',
33+
'Loading',
34+
'LoadMore',
35+
'Mask',
36+
'NoticeBar',
37+
'Popup',
38+
'Progress',
39+
'StatusShow',
40+
'Tag',
41+
'Steps',
42+
'Skeleton',
43+
'ArcPopup',
44+
'Segment',
45+
'Tabs',
46+
'CombinedTabs',
47+
'Toast',
48+
'Dialog',
49+
'Message',
50+
'SlideView',
51+
'ActionSheet',
52+
'Input',
53+
'Textarea',
54+
'Radio',
55+
'Checkbox',
56+
'ImagePicker',
57+
'Rules',
58+
'Rate',
59+
'Form',
60+
'Price',
61+
'Counter',
62+
'SearchBar',
63+
'IndexList'
64+
]
65+
]
66+
}
67+
};

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@
3333
"commit-msg": "commitlint -e $GIT_PARAMS"
3434
}
3535
},
36-
"commitlint": {
37-
"extends": [
38-
"@commitlint/config-conventional"
39-
]
40-
},
4136
"homepage": "http://doc.mini.7yue.pro",
4237
"devDependencies": {
4338
"@commitlint/cli": "^8.3.5",

0 commit comments

Comments
 (0)