Skip to content

Commit 966c15f

Browse files
committed
feat: added husky git hooks
1 parent dbc2c1f commit 966c15f

File tree

5 files changed

+700
-12
lines changed

5 files changed

+700
-12
lines changed

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx --no -- commitlint --edit ${1}

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
pnpm test

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"test:ui": "vitest --ui",
1010
"dev:docs": "vitepress dev docs",
1111
"serve:docs": "vitepress serve docs",
12-
"build:docs": "vitepress build docs"
12+
"build:docs": "vitepress build docs",
13+
"prepare": "husky install"
1314
},
1415
"repository": {
1516
"type": "git",
@@ -42,6 +43,8 @@
4243
"vitepress": "1.0.0-alpha.20"
4344
},
4445
"devDependencies": {
46+
"@commitlint/cli": "^17.2.0",
47+
"@commitlint/config-conventional": "^17.2.0",
4548
"@nrwl/nx-cloud": "^15.0.2",
4649
"@nrwl/workspace": "^15.0.10",
4750
"@types/lodash": "^4.14.187",
@@ -53,6 +56,7 @@
5356
"@vitest/ui": "^0.24.5",
5457
"@vue/test-utils": "^2.2.1",
5558
"eslint": "^8.23.1",
59+
"husky": "^8.0.2",
5660
"jsdom": "^20.0.2",
5761
"nx": "^15.0.0",
5862
"rimraf": "^3.0.2",

0 commit comments

Comments
 (0)