From aca1360164d1b46b63d7e33a9271db39c6e71207 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Fri, 29 May 2026 00:48:14 -0400 Subject: [PATCH] fix(l1): replace `any` casts with structural error types (eslint) Frontend CI failed on @typescript-eslint/no-explicit-any in three L1 post-review fix sites. Replace `(err as any).response...` with the codebase's established structural cast `(err as { response?: { data?: { detail?: string } } })`, matching TicketPickerModal / FolderEditModal / ProceduralEditorPage. The AccountSettingsPage 402 handler gets the fuller seat-limit detail shape. tsc clean, eslint clean. Co-Authored-By: Claude Opus 4.7 --- frontend/src/components/l1/L1WalkTreeVariant.tsx | 2 +- frontend/src/pages/AccountSettingsPage.tsx | 7 ++++++- frontend/src/pages/l1/L1Dashboard.tsx | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/l1/L1WalkTreeVariant.tsx b/frontend/src/components/l1/L1WalkTreeVariant.tsx index eaebcf3a..da9a12cb 100644 --- a/frontend/src/components/l1/L1WalkTreeVariant.tsx +++ b/frontend/src/components/l1/L1WalkTreeVariant.tsx @@ -42,7 +42,7 @@ export function L1WalkTreeVariant({ session, onSessionUpdate, onDone }: Props) { const lastError = (err: unknown): string => { if (typeof err === 'object' && err && 'response' in err) { - const detail = (err as any).response?.data?.detail + const detail = (err as { response?: { data?: { detail?: string } } }).response?.data?.detail if (typeof detail === 'string') return detail } return 'Unexpected error' diff --git a/frontend/src/pages/AccountSettingsPage.tsx b/frontend/src/pages/AccountSettingsPage.tsx index ea59273c..fe8ecffc 100644 --- a/frontend/src/pages/AccountSettingsPage.tsx +++ b/frontend/src/pages/AccountSettingsPage.tsx @@ -237,7 +237,12 @@ export function AccountSettingsPage() { const invitesData = await accountsApi.getInvites() setInvites(invitesData) } catch (err) { - const resp = (err as any)?.response + const resp = (err as { + response?: { + status?: number + data?: { detail?: { code?: string; role?: string; current?: number; limit?: number } } + } + }).response if (resp?.status === 402 && resp?.data?.detail?.code === 'seat_limit_exceeded') { const d = resp.data.detail const label = d.role === 'l1_tech' ? 'L1' : 'Engineer' diff --git a/frontend/src/pages/l1/L1Dashboard.tsx b/frontend/src/pages/l1/L1Dashboard.tsx index cefa3613..250fc148 100644 --- a/frontend/src/pages/l1/L1Dashboard.tsx +++ b/frontend/src/pages/l1/L1Dashboard.tsx @@ -48,7 +48,7 @@ export default function L1Dashboard() { }) navigate(`/l1/walk/${response.session_id}`) } catch (err) { - const detail = (err as any)?.response?.data?.detail + const detail = (err as { response?: { data?: { detail?: string } } }).response?.data?.detail const msg = typeof detail === 'string' ? detail : 'Failed to start walk. Try again.' toast.error(msg)