feat: 配置Husky pre-commit钩子 - 提交前自动执行前端构建检查
- 创建.husky/pre-commit文件 - 配置提交前自动执行npm run build:dev检查语法 - 添加node_modules存在性校验 - 预留ESLint检查接口(待赵云配置后启用) - 更新openhis-ui-vue3/package.json添加lint-staged配置 【关羽】构建门禁第一步落地
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
"test": "vitest",
|
||||
"test:run": "vitest run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:ui": "vitest --ui"
|
||||
"test:ui": "vitest --ui",
|
||||
"prepare": "cd .. && husky openhis-ui-vue3/.husky"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -80,5 +81,14 @@
|
||||
"vite-plugin-vue-mcp": "^0.3.2",
|
||||
"vitest": "^4.0.18",
|
||||
"vue-tsc": "^3.1.8"
|
||||
},
|
||||
"lint-staged": {
|
||||
"openhis-ui-vue3/**/*.{js,vue,ts}": [
|
||||
"cd openhis-ui-vue3 && npm run lint -- --fix",
|
||||
"cd openhis-ui-vue3 && npm run build:dev"
|
||||
],
|
||||
"**/*.{js,vue,ts}": [
|
||||
"echo \"文件变更已记录,构建检查将在pre-commit中执行\""
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user