From 6319ca272e4357587f6ea152cd461873bb458156 Mon Sep 17 00:00:00 2001 From: sudoooooo Date: Thu, 16 May 2024 21:15:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E6=89=93=E5=BC=80?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/package.json | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/web/package.json b/web/package.json index cada0c8c..b53d9fba 100644 --- a/web/package.json +++ b/web/package.json @@ -4,8 +4,8 @@ "private": true, "type": "module", "scripts": { - "serve": "vite", - "dev": "vite", + "serve": "npm run dev", + "dev": "vite --open", "build": "run-p type-check \"build-only {@}\" --", "preview": "vite preview", "build-only": "vite build", @@ -43,6 +43,7 @@ "@vue/tsconfig": "^0.5.1", "eslint": "^8.49.0", "eslint-plugin-vue": "^9.17.0", + "husky": "^9.0.11", "npm-run-all2": "^6.1.1", "prettier": "^3.0.3", "sass": "^1.72.0", @@ -54,8 +55,19 @@ "vite-plugin-virtual-mpa": "^1.11.0", "vue-tsc": "^1.8.27" }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "src/**/*.{.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts}": [ + "prettier --write", + "eslint --fix" + ] + }, "engines": { - "node": ">=14.21.0", - "npm": ">=6.14.17" + "node": ">=18.0.0", + "npm": ">=8.6.0" } }