Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# 进入 web 目录并运行类型检查
cd web && pnpm tsc --noEmit

if [ $? -ne 0 ]; then
echo "❌ TypeScript 类型检查失败,提交被阻止"
echo "请先修复类型错误再提交"
exit 1
fi

echo "✅ TypeScript 类型检查通过"
4 changes: 3 additions & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "eslint .",
"preview": "vite preview",
"format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\""
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
"prepare": "husky"
},
"dependencies": {
"@base-ui/react": "^1.0.0",
Expand Down Expand Up @@ -50,6 +51,7 @@
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.5.0",
"husky": "^9.1.7",
"prettier": "^3.7.4",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.4",
Expand Down
Loading