Skip to content

Commit 039ae13

Browse files
whhjdiclaude
andauthored
feat: Update TypeScript type checking to enforce builds and optimize lint-staged configuration (#185)
* feat: Update theme colors and shadow effects to enhance visual effects * Refactor code for improved readability and consistency across multiple pages - Cleaned up formatting and indentation in RequestsPage, RetryConfigsPage, RoutingStrategiesPage, SettingsPage, and StatsPage. - Simplified JSX structure by removing unnecessary line breaks and aligning props for better readability. - Enhanced the clarity of conditional rendering and logical expressions. - Ensured consistent use of single-line and multi-line formatting for JSX elements. - Improved the organization of imports and type definitions in StatsPage. * chore: configure lint-staged and enhance pre-commit hooks - Add lint-staged to auto-fix and format staged files on commit - Update pre-commit hook to run TypeScript type check and lint-staged - Configure lint-staged rules: - TypeScript/TSX: ESLint auto-fix + Prettier format - JS/JSX/JSON/CSS/MD: Prettier format - Improve commit workflow: fast, strict, and auto-fixing Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: Add localization support for response headers and response bodies * feat: Update lint-staged configuration to include TypeScript compilation check * feat: Update TypeScript type checking to enforce builds and optimize lint-staged configuration --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f5b1b7c commit 039ae13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1526
-1094
lines changed

.husky/pre-commit

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
#!/bin/sh
22

3-
# 进入 web 目录并运行类型检查
4-
cd web && pnpm tsc --noEmit
3+
cd web
4+
5+
# TypeScript 类型检查 (全量)
6+
echo "🔍 运行 TypeScript 类型检查..."
7+
pnpm tsc --build --force
58

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

12-
echo "✅ TypeScript 类型检查通过"
15+
# Lint 和格式化 (仅暂存文件)
16+
echo "🎨 运行 lint-staged (检查暂存文件)..."
17+
pnpm lint-staged
18+
19+
if [ $? -ne 0 ]; then
20+
echo "❌ Lint/格式化检查失败,提交被阻止"
21+
exit 1
22+
fi
23+
24+
echo "✅ 所有检查通过"

web/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
"format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
1414
"prepare": "husky"
1515
},
16+
"lint-staged": {
17+
"src/**/*.{ts,tsx}": [
18+
"eslint --fix",
19+
"prettier --write"
20+
],
21+
"src/**/*.{js,jsx,json,css,md}": [
22+
"prettier --write"
23+
]
24+
},
1625
"dependencies": {
1726
"@base-ui/react": "^1.0.0",
1827
"@dnd-kit/core": "^6.3.1",
@@ -56,6 +65,7 @@
5665
"eslint-plugin-react-refresh": "^0.4.24",
5766
"globals": "^16.5.0",
5867
"husky": "^9.1.7",
68+
"lint-staged": "^16.2.7",
5969
"prettier": "^3.7.4",
6070
"typescript": "~5.9.3",
6171
"typescript-eslint": "^8.46.4",

0 commit comments

Comments
 (0)