From 00b7012754f55e718af464c447a3d3895c51bd7a Mon Sep 17 00:00:00 2001 From: Zane Staggs Date: Thu, 29 May 2025 11:03:45 -0700 Subject: [PATCH 1/2] Phase 11: Fix implicit any parameters (TS7006 & TS7031) Complete elimination of implicit any parameter errors: - Fixed ConfigureProvidersGrid.tsx: Added proper typing for ConfirmationModal props and provider handlers - Fixed ProviderSetupModal.tsx: Added string type for keyName parameter in map function - Fixed AddModelModal.tsx: Added comprehensive typing for ModalButtons props and option handlers - Fixed OllamaForm.tsx: Added complete interface for component props and callback parameters - Fixed ProviderConfiguationModal.tsx: Added React.FormEvent typing for form handler - Fixed DefaultSubmitHandler.tsx: Added proper function parameter types with complex provider interface - Fixed OllamaSubmitHandler.tsx: Added Record typing for configValues - Fixed CustomRadio.tsx: Added comprehensive interface for all component props - Fixed Select.tsx: Added React.ComponentProps typing for ReactSelect props - Fixed main.ts: Added proper typing for Electron dialog response Reduced errors from 202 to 174 (28 errors eliminated) Eliminated ALL TS7006 and TS7031 errors (34 implicit any parameter errors eliminated) All linting checks pass with zero warnings --- .../components/settings/ProviderSetupModal.tsx | 2 +- .../providers/ConfigureProvidersGrid.tsx | 16 ++++++++++++---- .../models/subcomponents/AddModelModal.tsx | 16 +++++++++++++--- .../modal/ProviderConfiguationModal.tsx | 2 +- .../modal/subcomponents/forms/OllamaForm.tsx | 16 ++++++++++++---- .../handlers/DefaultSubmitHandler.tsx | 8 ++++++-- .../handlers/OllamaSubmitHandler.tsx | 2 +- ui/desktop/src/components/ui/CustomRadio.tsx | 11 +++++++++++ ui/desktop/src/components/ui/Select.tsx | 3 ++- ui/desktop/src/main.ts | 2 +- 10 files changed, 60 insertions(+), 18 deletions(-) diff --git a/ui/desktop/src/components/settings/ProviderSetupModal.tsx b/ui/desktop/src/components/settings/ProviderSetupModal.tsx index 00ecfc80d8e8..21dccd09aee1 100644 --- a/ui/desktop/src/components/settings/ProviderSetupModal.tsx +++ b/ui/desktop/src/components/settings/ProviderSetupModal.tsx @@ -59,7 +59,7 @@ export function ProviderSetupModal({ ) : (
- {requiredKeys.map((keyName) => ( + {requiredKeys.map((keyName: string) => (
void; + onCancel: () => void; +}) { return (
@@ -62,13 +70,13 @@ export function ConfigureProvidersGrid() { }); }, [activeKeys]); - const handleAddKeys = (provider) => { + const handleAddKeys = (provider: { id: string; name: string; isConfigured: boolean; description: string }) => { setSelectedForSetup(provider.id); setModalMode('setup'); setShowSetupModal(true); }; - const handleConfigure = (provider) => { + const handleConfigure = (provider: { id: string; name: string; isConfigured: boolean; description: string }) => { setSelectedForSetup(provider.id); setModalMode('edit'); setShowSetupModal(true); @@ -162,7 +170,7 @@ export function ConfigureProvidersGrid() { } }; - const handleDelete = async (provider) => { + const handleDelete = async (provider: { id: string; name: string; isConfigured: boolean; description: string }) => { setProviderToDelete(provider); setIsConfirmationOpen(true); }; diff --git a/ui/desktop/src/components/settings_v2/models/subcomponents/AddModelModal.tsx b/ui/desktop/src/components/settings_v2/models/subcomponents/AddModelModal.tsx index 99d6cd9326c1..0e8d9bf42f35 100644 --- a/ui/desktop/src/components/settings_v2/models/subcomponents/AddModelModal.tsx +++ b/ui/desktop/src/components/settings_v2/models/subcomponents/AddModelModal.tsx @@ -12,7 +12,17 @@ import type { View } from '../../../../App'; import Model, { getProviderMetadata } from '../modelInterface'; import { useModel } from '../../../settings/models/ModelContext'; -const ModalButtons = ({ onSubmit, onCancel, _isValid: _, _validationErrors: __ }) => ( +const ModalButtons = ({ + onSubmit, + onCancel, + _isValid: _, + _validationErrors: __ +}: { + onSubmit: () => void; + onCancel: () => void; + _isValid: boolean; + _validationErrors: { provider: string; model: string }; +}) => (
{urlError &&

{urlError}

} diff --git a/ui/desktop/src/components/ui/ConfirmationModal.tsx b/ui/desktop/src/components/ui/ConfirmationModal.tsx index 90b450cae7f5..3392cdef4b21 100644 --- a/ui/desktop/src/components/ui/ConfirmationModal.tsx +++ b/ui/desktop/src/components/ui/ConfirmationModal.tsx @@ -23,7 +23,6 @@ export function ConfirmationModal({