mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
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:
@@ -45,8 +45,6 @@ interface ValidateIssueInput {
|
||||
* ```
|
||||
*/
|
||||
export function useValidateIssue(projectPath: string) {
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: async (input: ValidateIssueInput) => {
|
||||
const { issue, model, thinkingLevel, reasoningEffort, comments, linkedPRs } = input;
|
||||
|
||||
@@ -93,7 +93,7 @@ export function useCommitWorktree() {
|
||||
}
|
||||
return result.result;
|
||||
},
|
||||
onSuccess: (_, { worktreePath }) => {
|
||||
onSuccess: (_, { worktreePath: _worktreePath }) => {
|
||||
// Invalidate all worktree queries since we don't know the project path
|
||||
queryClient.invalidateQueries({ queryKey: ['worktrees'] });
|
||||
toast.success('Changes committed');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck - Electron IPC boundary typing with stream events and message queuing
|
||||
import { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import type { Message, StreamEvent } from '@/types/electron';
|
||||
import { useMessageQueue } from './use-message-queue';
|
||||
@@ -161,16 +161,15 @@ export function useElectronAgent({
|
||||
);
|
||||
|
||||
// Message queue for queuing messages when agent is busy
|
||||
const { queuedMessages, isProcessingQueue, addToQueue, clearQueue, processNext } =
|
||||
useMessageQueue({
|
||||
onProcessNext: async (queuedMessage) => {
|
||||
await sendMessageDirectly(
|
||||
queuedMessage.content,
|
||||
queuedMessage.images,
|
||||
queuedMessage.textFiles
|
||||
);
|
||||
},
|
||||
});
|
||||
const { queuedMessages, isProcessingQueue, clearQueue, processNext } = useMessageQueue({
|
||||
onProcessNext: async (queuedMessage) => {
|
||||
await sendMessageDirectly(
|
||||
queuedMessage.content,
|
||||
queuedMessage.images,
|
||||
queuedMessage.textFiles
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
// Initialize connection and load history
|
||||
useEffect(() => {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* through WebSocket (indicating the connection is healthy).
|
||||
*/
|
||||
|
||||
import { useEffect, useCallback } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import { create } from 'zustand';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// @ts-nocheck
|
||||
// @ts-nocheck - responsive breakpoint logic with layout state calculations
|
||||
import { useState, useEffect, useLayoutEffect, useCallback, useRef } from 'react';
|
||||
import { useAppStore } from '@/store/app-store';
|
||||
|
||||
|
||||
@@ -53,17 +53,6 @@ interface MigrationState {
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* localStorage keys that may contain settings to migrate
|
||||
*/
|
||||
const LOCALSTORAGE_KEYS = [
|
||||
'automaker-storage',
|
||||
'automaker-setup',
|
||||
'worktree-panel-collapsed',
|
||||
'file-browser-recent-folders',
|
||||
'automaker:lastProjectDir',
|
||||
] as const;
|
||||
|
||||
// NOTE: We intentionally do NOT clear any localStorage keys after migration.
|
||||
// This allows users to switch back to older versions of Automaker that relied on localStorage.
|
||||
// The `localStorageMigrated` flag in server settings prevents re-migration on subsequent app loads.
|
||||
@@ -136,7 +125,7 @@ export function parseLocalStorageSettings(): Partial<GlobalSettings> | null {
|
||||
const cacheProjectCount = cached?.projects?.length ?? 0;
|
||||
logger.info(`[CACHE_LOADED] projects=${cacheProjectCount}, theme=${cached?.theme}`);
|
||||
return cached;
|
||||
} catch (e) {
|
||||
} catch {
|
||||
logger.warn('Failed to parse settings cache, falling back to old storage');
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -34,7 +34,6 @@ import {
|
||||
migratePhaseModelEntry,
|
||||
type GlobalSettings,
|
||||
type CursorModelId,
|
||||
type OpencodeModelId,
|
||||
type CodexModelId,
|
||||
type GeminiModelId,
|
||||
type CopilotModelId,
|
||||
|
||||
Reference in New Issue
Block a user