Skip to content

Commit 831732c

Browse files
committed
chore: replace husky with simple-git-hooks (#143)
1 parent 24f15fd commit 831732c

File tree

6 files changed

+1018
-120
lines changed

6 files changed

+1018
-120
lines changed

.husky/commit-msg

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

commitlint.config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { UserConfig } from '@commitlint/types'
2+
import { RuleConfigSeverity } from '@commitlint/types'
3+
4+
const Configuration: UserConfig = {
5+
extends: ['@commitlint/config-conventional'],
6+
formatter: '@commitlint/format',
7+
rules: {
8+
'type-enum': [
9+
RuleConfigSeverity.Error,
10+
'always',
11+
[
12+
'feat',
13+
'fix',
14+
'perf',
15+
'style',
16+
'docs',
17+
'test',
18+
'refactor',
19+
'build',
20+
'ci',
21+
'chore',
22+
'revert',
23+
'wip',
24+
'workflow',
25+
'types',
26+
'release',
27+
],
28+
],
29+
},
30+
}
31+
32+
export default Configuration

package.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"scripts": {
99
"dev": "cross-env MOCK_SERVER_PORT=8086 vite",
1010
"build": "vue-tsc --noEmit && vite build",
11-
"build:dev": "vue-tsc --noEmit && vite build --mode=development",
1211
"preview": "vite preview",
12+
"test": "vitest",
1313
"lint": "eslint .",
1414
"lint:fix": "eslint . --fix",
15-
"test": "vitest",
1615
"release": "bumpp --commit --push --tag",
17-
"prepare": "husky",
18-
"typecheck": "vue-tsc --noEmit"
16+
"typecheck": "vue-tsc --noEmit",
17+
"commitlint": "commitlint --edit",
18+
"prepare": "simple-git-hooks"
1919
},
2020
"dependencies": {
2121
"@unhead/vue": "~1.11.19",
@@ -37,6 +37,9 @@
3737
},
3838
"devDependencies": {
3939
"@antfu/eslint-config": "4.3.0",
40+
"@commitlint/cli": "^19.7.1",
41+
"@commitlint/config-conventional": "^19.7.1",
42+
"@commitlint/types": "^19.5.0",
4043
"@iconify-json/carbon": "^1.2.7",
4144
"@intlify/unplugin-vue-i18n": "^6.0.3",
4245
"@types/lodash-es": "^4.17.12",
@@ -53,11 +56,12 @@
5356
"cross-env": "^7.0.3",
5457
"eslint": "^9.20.1",
5558
"eslint-plugin-format": "^1.0.1",
56-
"husky": "^9.1.7",
5759
"less": "^4.2.2",
60+
"lint-staged": "^15.4.3",
5861
"mockjs": "^1.1.0",
5962
"postcss-mobile-forever": "^4.4.0",
6063
"rollup": "^4.34.8",
64+
"simple-git-hooks": "^2.11.1",
6165
"terser": "^5.39.0",
6266
"typescript": "^5.7.3",
6367
"unocss": "66.0.0",
@@ -82,5 +86,12 @@
8286
},
8387
"resolutions": {
8488
"vite": "^6.1.0"
89+
},
90+
"simple-git-hooks": {
91+
"pre-commit": "pnpm lint-staged",
92+
"commit-msg": "pnpm commitlint $1"
93+
},
94+
"lint-staged": {
95+
"*": "eslint --fix"
8596
}
8697
}

0 commit comments

Comments
 (0)