diff --git a/.husky/pre-commit b/.husky/pre-commit index 48d0778..d0a7784 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1 @@ -pnpm run format -pnpm run lint \ No newline at end of file +npx lint-staged \ No newline at end of file diff --git a/package.json b/package.json index 6af1d85..bfc0414 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,14 @@ "unplugin-vue-define-options": "^1.4.1", "vite": "4.5.3", "vite-plugin-cdn-import": "0.3.5" + }, + "lint-staged": { + "*.{js,ts,vue,jsx,tsx}": [ + "eslint --fix", + "prettier --write" + ], + "*.{scss,less,styl,html}": [ + "prettier --write" + ] } - }