Skip to content
This repository was archived by the owner on Oct 19, 2025. It is now read-only.

Commit 15eeb4e

Browse files
committed
husky and lint-staged added
1 parent c7edc9d commit 15eeb4e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.husky/pre-commit

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

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@
2727
"dev": "vite",
2828
"build": "vite build",
2929
"serve": "vite preview",
30-
"prepublishOnly": "npm run build"
30+
"pre-commit": "npx husky add .husky/pre-commit \"npx lint-staged\"",
31+
"prepublishOnly": "npm run build",
32+
"prepare": "npm run build && husky install"
33+
},
34+
"lint-staged": {
35+
"*.{vue,js}": [
36+
"eslint --fix"
37+
]
3138
},
3239
"dependencies": {
3340
"vue": "^3.2.6"
@@ -40,6 +47,7 @@
4047
"eslint-config-prettier": "^8.3.0",
4148
"eslint-plugin-prettier": "^3.4.1",
4249
"eslint-plugin-vue": "^7.17.0",
50+
"husky": "^7.0.2",
4351
"lint-staged": "^11.1.2",
4452
"prettier": "^2.3.2",
4553
"vite": "^2.5.1",

0 commit comments

Comments
 (0)