From a83708b3141b70f808dc75fb3a6d2e6679b4a6c6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 19 Jul 2026 14:15:54 +0000 Subject: [PATCH] Avoid any type for setting value in SettingsModal Replaced 'any' type with 'string | number | boolean' in handleValueChange. Updated the 'id' parameter type to 'keyof EditorSettings' to enforce compile-time correctness. Co-authored-by: beingniloy <235952944+beingniloy@users.noreply.github.com> --- src/components/modals/SettingsModal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/modals/SettingsModal.tsx b/src/components/modals/SettingsModal.tsx index 8b69fc3..2a169fc 100644 --- a/src/components/modals/SettingsModal.tsx +++ b/src/components/modals/SettingsModal.tsx @@ -7,6 +7,7 @@ import { showAlert, showConfirm } from '../../hooks/useDialog'; import { useTranslation } from '../../hooks/useTranslation'; import { overlayStyle, modalStyle, closeBtnStyle, secondaryBtnStyle, sidebarBtnStyle } from './shared'; import { SETTINGS_DEF, DEFAULT_SETTINGS } from '../../settingsDef'; +import { EditorSettings } from '../../types'; type SettingsSection = 'editor' | 'workbench' | 'security' | 'terminal' | 'cloud' | 'about'; @@ -85,7 +86,7 @@ export function SettingsModal({ onClose }: { onClose?: () => void }) { return matchesSection && matchesSearch; }); - const handleValueChange = (id: string, val: any) => setFormData(prev => ({ ...prev, [id]: val })); + const handleValueChange = (id: keyof EditorSettings, val: string | number | boolean) => setFormData(prev => ({ ...prev, [id]: val })); const handleJsonEditorChange = (value: string | undefined) => { if (!value) return;