fix: resolve ESLint errors to pass CI frontend-lint #125

Merged
xiaoxia merged 1 commits from fix/eslint-errors into develop 2026-06-30 17:21:49 +08:00
Owner

修复内容

修复 CI frontend-lint job 的 2 个 ESLint error:

  1. src/test/hooks/useAuth.test.ts.tsx:文件包含 JSX 语法(<BrowserRouter><QueryClientProvider>),但使用了 .ts 扩展名导致 ESLint 解析失败(Parsing error: > expected)
  2. src/test/setup.tsnamespace Vi 触发 @typescript-eslint/no-namespace 规则,添加 eslint-disable 注释(Vitest 类型增强必须使用 namespace 语法)

验证结果

  • 修复前:✖ 58 problems (2 errors, 56 warnings)
  • 修复后:✖ 56 problems (0 errors, 56 warnings)

56 个 warnings 为历史遗留的 @typescript-eslint/no-explicit-any 等,不在本次修复范围。

## 修复内容 修复 CI frontend-lint job 的 2 个 ESLint error: 1. **`src/test/hooks/useAuth.test.ts` → `.tsx`**:文件包含 JSX 语法(`<BrowserRouter>`、`<QueryClientProvider>`),但使用了 `.ts` 扩展名导致 ESLint 解析失败(Parsing error: > expected) 2. **`src/test/setup.ts`**:`namespace Vi` 触发 `@typescript-eslint/no-namespace` 规则,添加 eslint-disable 注释(Vitest 类型增强必须使用 namespace 语法) ## 验证结果 - 修复前:`✖ 58 problems (2 errors, 56 warnings)` - 修复后:`✖ 56 problems (0 errors, 56 warnings)` 56 个 warnings 为历史遗留的 `@typescript-eslint/no-explicit-any` 等,不在本次修复范围。
xiaoxia added 1 commit 2026-06-30 17:18:24 +08:00
fix: resolve ESLint errors to pass CI frontend-lint
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 211h36m4s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 211h36m10s
252a854a9d
- Rename useAuth.test.ts → useAuth.test.tsx (file contains JSX, needs TSX extension)
- Add eslint-disable for @typescript-eslint/no-namespace in test/setup.ts (required for Vitest type augmentation)
xiaoxia merged commit 1e6f78a346 into develop 2026-06-30 17:21:49 +08:00
Sign in to join this conversation.