From 1897641082e9ae16b33a366456c131e47a7bf8ba Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Fri, 6 Feb 2026 17:38:38 -0500 Subject: [PATCH] fix: resolve all 8 pre-existing lint errors (closes #29) Fixed @typescript-eslint/no-explicit-any (4 occurrences): - FolderEditModal.tsx: proper error type checking instead of any - StepForm.tsx: explicit union type for visibility select - StepLibraryBrowser.tsx: explicit union types for stepType and sortBy selects Fixed react-hooks/set-state-in-effect (1 occurrence): - NodeEditorModal.tsx: replaced useEffect with direct state comparison Fixed @typescript-eslint/no-unused-vars (3 occurrences): - NodeEditorModal.tsx: removed unused useEffect import - NodeEditorModal.tsx: added eslint-disable for intentionally destructured children - usePermissions.ts: removed unused _tree parameter from canDeleteTree - TreeLibraryPage.tsx: updated canDeleteTree call site Fixed @typescript-eslint/no-empty-object-type (1 occurrence): - types/step.ts: changed empty interface to type alias Verification: - npm run lint: 0 errors (9 warnings are intentional exhaustive-deps) - npm run build: succeeds - TypeScript compilation: passes Co-Authored-By: Claude Opus 4.6 --- frontend/src/components/library/FolderEditModal.tsx | 7 +++++-- frontend/src/components/step-library/StepForm.tsx | 2 +- .../components/step-library/StepLibraryBrowser.tsx | 4 ++-- .../src/components/tree-editor/NodeEditorModal.tsx | 11 +++++++---- frontend/src/hooks/usePermissions.ts | 2 +- frontend/src/pages/TreeLibraryPage.tsx | 2 +- frontend/src/types/step.ts | 5 ++--- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/library/FolderEditModal.tsx b/frontend/src/components/library/FolderEditModal.tsx index 4a173622..27d9a566 100644 --- a/frontend/src/components/library/FolderEditModal.tsx +++ b/frontend/src/components/library/FolderEditModal.tsx @@ -159,8 +159,11 @@ export function FolderEditModal({ onClose() // Dispatch event to refresh folder list window.dispatchEvent(new Event('folder-changed')) - } catch (err: any) { - setError(err.response?.data?.detail || 'Failed to save folder') + } catch (err) { + const errorMessage = err instanceof Error && 'response' in err + ? (err as { response?: { data?: { detail?: string } } }).response?.data?.detail + : undefined + setError(errorMessage || 'Failed to save folder') } finally { setIsSubmitting(false) } diff --git a/frontend/src/components/step-library/StepForm.tsx b/frontend/src/components/step-library/StepForm.tsx index 4c2254b4..8ad06e75 100644 --- a/frontend/src/components/step-library/StepForm.tsx +++ b/frontend/src/components/step-library/StepForm.tsx @@ -356,7 +356,7 @@ export function StepForm({ onSubmit, onCancel, initialData }: StepFormProps) { setSelectedStepType((e.target.value as any) || undefined)} + onChange={(e) => setSelectedStepType((e.target.value as 'decision' | 'action' | 'solution') || undefined)} className="rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring" > @@ -190,7 +190,7 @@ export function StepLibraryBrowser({ onInsert, onCreateNew, showCreateButton = f