chore: Fix all lint errors and remove unused code

- Fix 75 ESLint errors by updating eslint.config.mjs:
  - Add missing browser globals (MouseEvent, AbortController, Response, etc.)
  - Add Vite define global (__APP_VERSION__)
  - Configure @ts-nocheck to require descriptions
  - Add no-unused-vars rule for .mjs scripts

- Fix runtime bug in agent-output-modal.tsx (setOutput -> setStreamedContent)

- Remove ~120 unused variable warnings across 97 files:
  - Remove unused imports (React hooks, lucide icons, types)
  - Remove unused constants and variables
  - Remove unused function definitions
  - Prefix intentionally unused parameters with underscore

- Add descriptions to all @ts-nocheck comments (25 files)

- Clean up misc issues:
  - Remove invalid deprecation plugin comments
  - Fix eslint-disable comment placement
  - Add missing RefreshCw import in code-view.tsx

Reduces lint warnings from ~300 to 67 (all remaining are no-explicit-any)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shirone
2026-01-25 17:33:45 +01:00
parent 3b56d553c9
commit 006152554b
97 changed files with 129 additions and 339 deletions

View File

@@ -14,8 +14,7 @@ import { toast } from 'sonner';
export function ApiKeysSection() {
const { apiKeys, setApiKeys } = useAppStore();
const { claudeAuthStatus, setClaudeAuthStatus, codexAuthStatus, setCodexAuthStatus } =
useSetupStore();
const { claudeAuthStatus, setClaudeAuthStatus, setCodexAuthStatus } = useSetupStore();
const [isDeletingAnthropicKey, setIsDeletingAnthropicKey] = useState(false);
const [isDeletingOpenaiKey, setIsDeletingOpenaiKey] = useState(false);
@@ -45,7 +44,7 @@ export function ApiKeysSection() {
} else {
toast.error(result.error || 'Failed to delete API key');
}
} catch (error) {
} catch {
toast.error('Failed to delete API key');
} finally {
setIsDeletingAnthropicKey(false);
@@ -73,7 +72,7 @@ export function ApiKeysSection() {
} else {
toast.error(result.error || 'Failed to delete API key');
}
} catch (error) {
} catch {
toast.error('Failed to delete API key');
} finally {
setIsDeletingOpenaiKey(false);

View File

@@ -1,4 +1,4 @@
// @ts-nocheck
// @ts-nocheck - API key management state with validation and persistence
import { useState, useEffect } from 'react';
import { createLogger } from '@automaker/utils/logger';
import { useAppStore } from '@/store/app-store';

View File

@@ -12,7 +12,6 @@ import { cn } from '@/lib/utils';
import { useAppStore } from '@/store/app-store';
import { FontSelector } from '@/components/shared';
import type { Theme } from '../shared/types';
import type { SidebarStyle } from '@automaker/types';
interface AppearanceSectionProps {
effectiveTheme: Theme;

View File

@@ -1,7 +1,7 @@
import { Button } from '@/components/ui/button';
import { SkeletonPulse } from '@/components/ui/skeleton';
import { Spinner } from '@/components/ui/spinner';
import { CheckCircle2, AlertCircle, RefreshCw, Key } from 'lucide-react';
import { CheckCircle2, AlertCircle, RefreshCw } from 'lucide-react';
import { cn } from '@/lib/utils';
import type { CliStatus } from '../shared/types';
import { GeminiIcon } from '@/components/ui/provider-icon';

View File

@@ -3,7 +3,7 @@ import { ChevronDown, ChevronRight, X } from 'lucide-react';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
import type { Project } from '@/lib/electron';
import type { NavigationItem, NavigationGroup } from '../config/navigation';
import type { NavigationItem } from '../config/navigation';
import { GLOBAL_NAV_GROUPS } from '../config/navigation';
import type { SettingsViewId } from '../hooks/use-settings-view';
import { useAppStore } from '@/store/app-store';
@@ -189,7 +189,7 @@ function NavItemWithSubItems({
export function SettingsNavigation({
activeSection,
currentProject,
currentProject: _currentProject,
onNavigate,
isOpen = true,
onClose,

View File

@@ -1,4 +1,4 @@
import { useState, useCallback, useEffect } from 'react';
import { useState, useCallback } from 'react';
import { useCursorPermissionsQuery, type CursorPermissionsData } from '@/hooks/queries';
import { useApplyCursorProfile, useCopyCursorConfig } from '@/hooks/mutations';

View File

@@ -1,7 +1,6 @@
import { Plug, RefreshCw, Download, Code, FileJson, Plus } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Spinner } from '@/components/ui/spinner';
import { cn } from '@/lib/utils';
interface MCPServerHeaderProps {
isRefreshing: boolean;

View File

@@ -27,7 +27,7 @@ export function SecurityWarningDialog({
onOpenChange,
onConfirm,
serverType,
serverName,
_serverName,
command,
args,
url,

View File

@@ -16,7 +16,6 @@ import type {
ClaudeModelAlias,
} from '@automaker/types';
import {
stripProviderPrefix,
STANDALONE_CURSOR_MODELS,
getModelGroup,
isGroupSelected,
@@ -567,7 +566,7 @@ export function PhaseModelSelector({
const isCopilotDisabled = disabledProviders.includes('copilot');
// Group models (filtering out disabled providers)
const { favorites, claude, cursor, codex, gemini, copilot, opencode } = useMemo(() => {
const { favorites, claude, codex, gemini, copilot, opencode } = useMemo(() => {
const favs: typeof CLAUDE_MODELS = [];
const cModels: typeof CLAUDE_MODELS = [];
const curModels: typeof CURSOR_MODELS = [];
@@ -651,7 +650,6 @@ export function PhaseModelSelector({
return {
favorites: favs,
claude: cModels,
cursor: curModels,
codex: codModels,
gemini: gemModels,
copilot: copModels,
@@ -2117,7 +2115,7 @@ export function PhaseModelSelector({
{opencodeSections.length > 0 && (
<CommandGroup heading={OPENCODE_CLI_GROUP_LABEL}>
{opencodeSections.map((section, sectionIndex) => (
{opencodeSections.map((section, _sectionIndex) => (
<Fragment key={section.key}>
<div className="px-2 pt-2 text-xs font-medium text-muted-foreground">
{section.label}

View File

@@ -1,4 +1,4 @@
// @ts-nocheck
// @ts-nocheck - Claude settings form with CLI status and authentication state
import { useAppStore } from '@/store/app-store';
import { useSetupStore } from '@/store/setup-store';
import { useCliStatus } from '../hooks/use-cli-status';

View File

@@ -24,7 +24,6 @@ export function SubagentsSection() {
const {
subagentsWithScope,
isLoading: isLoadingAgents,
hasProject,
refreshFilesystemAgents,
} = useSubagents();
const {

View File

@@ -16,18 +16,13 @@ const logger = createLogger('CodexSettings');
export function CodexSettingsTab() {
const {
codexAutoLoadAgents,
codexSandboxMode,
codexApprovalPolicy,
codexEnableWebSearch,
codexEnableImages,
enabledCodexModels,
codexDefaultModel,
setCodexAutoLoadAgents,
setCodexSandboxMode,
setCodexApprovalPolicy,
setCodexEnableWebSearch,
setCodexEnableImages,
setEnabledCodexModels,
setCodexDefaultModel,
toggleCodexModel,
} = useAppStore();

View File

@@ -44,7 +44,7 @@ export function CursorSettingsTab() {
try {
setCursorDefaultModel(model);
toast.success('Default model updated');
} catch (error) {
} catch {
toast.error('Failed to update default model');
} finally {
setIsSaving(false);
@@ -55,7 +55,7 @@ export function CursorSettingsTab() {
setIsSaving(true);
try {
toggleCursorModel(model, enabled);
} catch (error) {
} catch {
toast.error('Failed to update models');
} finally {
setIsSaving(false);

View File

@@ -23,13 +23,8 @@ import { OPENCODE_MODELS, OPENCODE_MODEL_CONFIG_MAP } from '@automaker/types';
import type { OpenCodeProviderInfo } from '../cli-status/opencode-cli-status';
import {
OpenCodeIcon,
DeepSeekIcon,
QwenIcon,
NovaIcon,
AnthropicIcon,
OpenRouterIcon,
MistralIcon,
MetaIcon,
GeminiIcon,
OpenAIIcon,
GrokIcon,
@@ -226,8 +221,6 @@ export function OpencodeModelConfiguration({
const selectableStaticModelIds = allStaticModelIds.filter(
(modelId) => modelId !== opencodeDefaultModel
);
const allDynamicModelIds = dynamicModels.map((model) => model.id);
const hasDynamicModels = allDynamicModelIds.length > 0;
const staticSelectState = getSelectionState(selectableStaticModelIds, enabledOpencodeModels);
// Order: Free tier first, then Claude, then others