Skip to content

Commit 5315b4f

Browse files
committed
feat: support git cz
1 parent b82ab5e commit 5315b4f

File tree

3 files changed

+997
-16
lines changed

3 files changed

+997
-16
lines changed

commitlint.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'type-enum': [
5+
2,
6+
'always',
7+
['feat', 'fix', 'docs', 'style', 'refactor', 'test', 'build', 'ci', 'chore']
8+
],
9+
'scope-case': [0, 'always'],
10+
'scope-empty': [0, 'always']
11+
}
12+
};

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@
4444
"registry": "https://registry.npmjs.org/"
4545
},
4646
"devDependencies": {
47+
"@commitlint/cli": "^17.7.2",
48+
"@commitlint/config-conventional": "^17.7.0",
49+
"@commitlint/cz-commitlint": "^17.7.2",
4750
"@types/mocha": "^9.1.0",
4851
"@types/node": "^20.4.0",
52+
"commitizen": "^4.3.0",
4953
"fast-glob": "^3.3.2",
5054
"gh-pages": "^3.2.3",
5155
"inquirer": "^8.2.2",
@@ -71,5 +75,15 @@
7175
"engines": {
7276
"node": ">=18"
7377
},
74-
"packageManager": "pnpm@9.7.0"
78+
"packageManager": "pnpm@9.7.0",
79+
"config": {
80+
"commitizen": {
81+
"path": "./node_modules/@commitlint/cz-commitlint"
82+
}
83+
},
84+
"lint-staged": {
85+
"*": [
86+
"prettier --write --ignore-unknown"
87+
]
88+
}
7589
}

0 commit comments

Comments
 (0)