From bc04e59075dec2cc28409147165d2cc2acea8acd Mon Sep 17 00:00:00 2001 From: mkorwel Date: Thu, 16 Apr 2026 07:28:35 +0000 Subject: [PATCH] fix(cli): resolve lint errors preventing pipeline extraction --- .../cli/src/ui/auth/LoginWithGoogleRestartDialog.test.tsx | 3 ++- packages/cli/src/ui/contexts/KeypressContext.tsx | 2 -- packages/cli/test-setup.ts | 7 ++++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cli/src/ui/auth/LoginWithGoogleRestartDialog.test.tsx b/packages/cli/src/ui/auth/LoginWithGoogleRestartDialog.test.tsx index 5c34ae9668..51d72b1540 100644 --- a/packages/cli/src/ui/auth/LoginWithGoogleRestartDialog.test.tsx +++ b/packages/cli/src/ui/auth/LoginWithGoogleRestartDialog.test.tsx @@ -10,6 +10,7 @@ import { LoginWithGoogleRestartDialog } from './LoginWithGoogleRestartDialog.js' import { useKeypress } from '../hooks/useKeypress.js'; import { _resetRelaunchStateForTesting, + relaunchApp, } from '../../utils/processUtils.js'; import { type Config } from '@google/gemini-cli-core'; @@ -25,7 +26,7 @@ vi.mock('../../utils/processUtils.js', () => ({ })); const mockedUseKeypress = useKeypress as Mock; -import { relaunchApp } from '../../utils/processUtils.js'; + const mockedRelaunchApp = relaunchApp as Mock; describe('LoginWithGoogleRestartDialog', () => { diff --git a/packages/cli/src/ui/contexts/KeypressContext.tsx b/packages/cli/src/ui/contexts/KeypressContext.tsx index 248a17982d..d834608fbe 100644 --- a/packages/cli/src/ui/contexts/KeypressContext.tsx +++ b/packages/cli/src/ui/contexts/KeypressContext.tsx @@ -784,8 +784,6 @@ export function KeypressProvider({ children: React.ReactNode; config?: Config; }) { - if (process.env['NODE_ENV'] === 'test') { - } const { settings } = useSettingsStore(); const debugKeystrokeLogging = settings.merged.general.debugKeystrokeLogging; diff --git a/packages/cli/test-setup.ts b/packages/cli/test-setup.ts index 4f4d9f458c..c35cb44ceb 100644 --- a/packages/cli/test-setup.ts +++ b/packages/cli/test-setup.ts @@ -40,7 +40,8 @@ const createNoiseFilter = (method: keyof Console) => { const original = console[method]; // eslint-disable-next-line @typescript-eslint/no-explicit-any (console as any)[method] = new Proxy(original, { - apply(target: any, thisArg: any, argArray: any[]) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + apply(target: Function, thisArg: unknown, argArray: unknown[]) { const firstArg = String(argArray[0]); if (noiseStrings.some((s) => firstArg.includes(s))) { return; @@ -74,11 +75,11 @@ beforeEach(async () => { // Reset singletons to ensure test isolation themeManager.resetForTesting(); uiTelemetryService.clear(); - // We do NOT remove all listeners here because it would break the + // We do NOT remove all listeners here because it would break the // SessionContext subscription created during component mount. // Instead, we rely on individual tests to manage their specific listeners // or the clear() method to reset state. - + await resetBrowserSession(); // Force specific env for test stability