From 075fe88477e50e43bcc057b0a54b9fb0f7eda7c2 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 7 Aug 2026 15:08:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20ESLint=20=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20=E2=80=94=20=E7=A7=BB=E9=99=A4=E6=9C=AA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E8=A7=A3=E6=9E=84=E5=8F=98=E9=87=8F=20+=20?= =?UTF-8?q?=E6=B8=85=E7=90=86=E6=97=A0=E7=94=A8=20eslint-disable=20?= =?UTF-8?q?=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Step3GeneratePreview.tsx: - templateName/materialCount/videoRatio 在删除剪辑方案信息卡片后不再使用,改为 _xxx 别名 清理 develop 上遗留的无用 eslint-disable 指令: - useTtsPanel.ts: react-hooks/exhaustive-deps - ProtectedRoute.tsx: react-refresh/only-export-components - client.test.ts: @typescript-eslint/no-explicit-any (5处) - setup.ts: @typescript-eslint/no-explicit-any (2处) --- .../editing-planner/components/TtsPanel/hooks/useTtsPanel.ts | 1 - apps/web/src/router/ProtectedRoute.tsx | 1 - apps/web/src/test/api/client.test.ts | 5 ----- apps/web/src/test/setup.ts | 2 -- 4 files changed, 9 deletions(-) diff --git a/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts b/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts index 6d3021f55..27ab249d8 100644 --- a/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts +++ b/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts @@ -60,7 +60,6 @@ export const useTtsPanel = ({ open, config, onChange, onClose }: UseTtsPanelOpti return () => { active = false } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [open]) /* ── 组件卸载时清理音频资源 ── */ diff --git a/apps/web/src/router/ProtectedRoute.tsx b/apps/web/src/router/ProtectedRoute.tsx index b1f2fa12f..2c49851ff 100644 --- a/apps/web/src/router/ProtectedRoute.tsx +++ b/apps/web/src/router/ProtectedRoute.tsx @@ -3,7 +3,6 @@ import { Navigate } from "react-router-dom" import { useAuthStore } from "@/store/authStore" /** 受保护的路由组件 */ -// eslint-disable-next-line react-refresh/only-export-components export const ProtectedRoute = ({ children }: { children: React.ReactNode }) => { const isAuthenticated = useAuthStore((state) => state.isAuthenticated) const hasAccessToken = Boolean(localStorage.getItem("access_token")) diff --git a/apps/web/src/test/api/client.test.ts b/apps/web/src/test/api/client.test.ts index b9986ee12..d38297266 100644 --- a/apps/web/src/test/api/client.test.ts +++ b/apps/web/src/test/api/client.test.ts @@ -26,12 +26,10 @@ import { refreshAccessToken } from "@/api/auth" import apiClient from "@/api/client" // 从真实实例取出拦截器回调 -// eslint-disable-next-line @typescript-eslint/no-explicit-any const requestHandlers = (apiClient as any).interceptors.request.handlers as Array<{ fulfilled: (config: unknown) => unknown rejected: (error: unknown) => unknown }> -// eslint-disable-next-line @typescript-eslint/no-explicit-any const responseHandlers = (apiClient as any).interceptors.response.handlers as Array<{ fulfilled: (response: unknown) => unknown rejected: (error: unknown) => Promise @@ -258,7 +256,6 @@ describe("apiClient - 401 token refresh", () => { isAuthenticated: false, clearAuth: mockClearAuth, setAuth: vi.fn(), - // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) const err = makeAxiosError(401, { detail: "Unauthorized" }) @@ -276,7 +273,6 @@ describe("apiClient - 401 token refresh", () => { isAuthenticated: true, clearAuth: vi.fn(), setAuth: mockSetAuth, - // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) vi.mocked(refreshAccessToken).mockResolvedValue({ access_token: "new-access", @@ -306,7 +302,6 @@ describe("apiClient - 401 token refresh", () => { isAuthenticated: true, clearAuth: mockClearAuth, setAuth: vi.fn(), - // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) vi.mocked(refreshAccessToken).mockRejectedValue(new Error("refresh failed") as never) diff --git a/apps/web/src/test/setup.ts b/apps/web/src/test/setup.ts index ae3c9729c..69181c10d 100644 --- a/apps/web/src/test/setup.ts +++ b/apps/web/src/test/setup.ts @@ -32,9 +32,7 @@ afterEach(() => { declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace Vi { - // eslint-disable-next-line @typescript-eslint/no-explicit-any interface Assertion extends jest.Matchers {} - // eslint-disable-next-line @typescript-eslint/no-explicit-any interface AsymmetricMatchersContaining extends jest.Matchers {} } }