Skip to content

Commit 24f21ad

Browse files
committed
refactor: normalize commit message
1 parent ec1b0af commit 24f21ad

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] };

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@
3232
"@babel/core": "^7.12.10",
3333
"@babel/preset-env": "^7.12.11",
3434
"@babel/preset-typescript": "^7.12.7",
35+
"@commitlint/cli": "^16.0.2",
36+
"@commitlint/config-conventional": "^16.0.0",
3537
"@types/jest": "^27.0.3",
3638
"@typescript-eslint/eslint-plugin": "^5.6.0",
3739
"@typescript-eslint/parser": "^5.6.0",
3840
"babel-jest": "^26.6.3",
41+
"commitizen": "^4.2.4",
3942
"cross-env": "^7.0.2",
43+
"cz-conventional-changelog": "^3.3.0",
4044
"del": "^5.1.0",
4145
"eslint": "^7.0.0",
4246
"eslint-config-airbnb-base": "^14.2.1",
@@ -66,9 +70,16 @@
6670
"typescript": "^4.5.2",
6771
"vite": "^2.7.6"
6872
},
73+
"config": {
74+
"commitizen": {
75+
"path": "./node_modules/cz-conventional-changelog"
76+
}
77+
},
6978
"husky": {
7079
"hooks": {
71-
"pre-commit": "lint-staged"
80+
"pre-commit": "lint-staged",
81+
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
82+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
7283
}
7384
},
7485
"lint-staged": {
@@ -85,4 +96,4 @@
8596
"workspaces": [
8697
"./site"
8798
]
88-
}
99+
}

0 commit comments

Comments
 (0)