zhangjie 2 周之前
父节点
当前提交
00479a7c8d
共有 4 个文件被更改,包括 18 次插入3 次删除
  1. 2 0
      .husky/commit-msg
  2. 3 0
      .husky/pre-commit
  3. 5 3
      package.json
  4. 8 0
      pnpm-lock.yaml

+ 2 - 0
.husky/commit-msg

@@ -0,0 +1,2 @@
+
+pnpm commitlint --edit $1

+ 3 - 0
.husky/pre-commit

@@ -0,0 +1,3 @@
+
+npm run lint-staged
+npm run typecheck

+ 5 - 3
package.json

@@ -10,8 +10,9 @@
     "build": "vite build --config ./config/vite.config.prod.ts",
     "report": "cross-env REPORT=true npm run build",
     "preview": "npm run build && vite preview --host",
-    "type:check": "vue-tsc --noEmit --skipLibCheck",
-    "lint-staged": "npx lint-staged"
+    "typecheck": "vue-tsc --noEmit --skipLibCheck",
+    "lint-staged": "npx lint-staged",
+    "prepare": "husky"
   },
   "lint-staged": {
     "*.{js,ts,jsx,tsx}": [
@@ -65,6 +66,7 @@
     "eslint-plugin-import": "^2.26.0",
     "eslint-plugin-prettier": "^4.2.1",
     "eslint-plugin-vue": "^9.6.0",
+    "husky": "^9.1.7",
     "less": "^4.1.3",
     "lint-staged": "^13.0.3",
     "mockjs": "^1.1.0",
@@ -90,4 +92,4 @@
     "rollup": "^2.56.3",
     "gifsicle": "5.2.0"
   }
-}
+}

+ 8 - 0
pnpm-lock.yaml

@@ -32,6 +32,7 @@ specifiers:
   eslint-plugin-import: ^2.26.0
   eslint-plugin-prettier: ^4.2.1
   eslint-plugin-vue: ^9.6.0
+  husky: ^9.1.7
   js-md5: ^0.8.3
   less: ^4.1.3
   lint-staged: ^13.0.3
@@ -98,6 +99,7 @@ devDependencies:
   eslint-plugin-import: 2.31.0_ufypjdn53dyrqi4r3krytwmgdq
   eslint-plugin-prettier: 4.2.1_l5k3x6vt4o46v5v3huajal7yxq
   eslint-plugin-vue: 9.33.0_eslint@8.57.1
+  husky: 9.1.7
   less: 4.3.0
   lint-staged: 13.3.0
   mockjs: 1.1.0
@@ -3867,6 +3869,12 @@ packages:
     engines: {node: '>=14.18.0'}
     dev: true
 
+  /husky/9.1.7:
+    resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==}
+    engines: {node: '>=18'}
+    hasBin: true
+    dev: true
+
   /iconv-lite/0.6.3:
     resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
     engines: {node: '>=0.10.0'}