Skip to content

Commit 766f7fc

Browse files
committed
chore: use commitlint to standardize the commit messages
1 parent d4584fe commit 766f7fc

3 files changed

Lines changed: 420 additions & 28 deletions

File tree

commitlint.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { UserConfig } from '@commitlint/types'
2+
import { RuleConfigSeverity } from '@commitlint/types'
3+
4+
const Configuration: UserConfig = {
5+
extends: ['@commitlint/config-conventional'],
6+
rules: {
7+
'type-enum': [
8+
RuleConfigSeverity.Error,
9+
'always',
10+
['feat', 'fix', 'docs', 'style', 'refactor', 'test', 'chore', 'revert', 'ci', 'build'],
11+
],
12+
'scope-max-length': [RuleConfigSeverity.Error, 'always', 20],
13+
'subject-case': [RuleConfigSeverity.Error, 'always', 'lower-case'],
14+
'subject-max-length': [RuleConfigSeverity.Error, 'always', 72],
15+
},
16+
}
17+
18+
export default Configuration

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"defu": "6.1.4",
7777
"fast-npm-meta": "1.0.0",
7878
"focus-trap": "^7.8.0",
79-
"tinyglobby": "0.2.15",
8079
"marked": "17.0.1",
8180
"module-replacements": "2.11.0",
8281
"nuxt": "4.3.0",
@@ -89,6 +88,7 @@
8988
"simple-git": "3.30.0",
9089
"spdx-license-list": "6.11.0",
9190
"std-env": "3.10.0",
91+
"tinyglobby": "0.2.15",
9292
"ufo": "1.6.3",
9393
"unocss": "66.6.0",
9494
"unplugin-vue-router": "0.19.2",
@@ -101,6 +101,9 @@
101101
"vue-data-ui": "3.14.3"
102102
},
103103
"devDependencies": {
104+
"@commitlint/cli": "20.4.1",
105+
"@commitlint/config-conventional": "20.4.1",
106+
"@commitlint/types": "20.4.0",
104107
"@intlify/core-base": "11.2.8",
105108
"@npm/types": "2.1.0",
106109
"@playwright/test": "1.58.1",
@@ -129,7 +132,8 @@
129132
"node": ">=24"
130133
},
131134
"simple-git-hooks": {
132-
"pre-commit": "npx lint-staged"
135+
"pre-commit": "npx lint-staged",
136+
"commit-msg": "npx --no -- commitlint --edit"
133137
},
134138
"lint-staged": {
135139
"i18n/locales/*": [

0 commit comments

Comments
 (0)