From 0bf69acafe37db4e84557fee33101d0ab901de65 Mon Sep 17 00:00:00 2001 From: William Valentin Date: Mon, 23 Feb 2026 16:51:44 -0800 Subject: [PATCH] fix(lint): clear error-level violations across runtime and ui --- src/backends/native/agent.ts | 2 +- src/cli/skills.test.ts | 2 +- src/companion/platformClients.test.ts | 2 +- src/gateway/modelCatalog.ts | 2 +- src/gateway/ui/app.js | 12 +++++++++--- src/gateway/ui/lib/pwa.js | 2 ++ src/gateway/ui/sw.js | 2 ++ src/skills/registrySource.ts | 2 +- src/tools/builtin/audio-transcribe.ts | 2 +- src/tools/builtin/minio-sync.ts | 2 +- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/backends/native/agent.ts b/src/backends/native/agent.ts index f0d75d0..b737722 100644 --- a/src/backends/native/agent.ts +++ b/src/backends/native/agent.ts @@ -145,7 +145,7 @@ export class NativeAgent { this.modelClient.clearAbort(); } this._runInProgress = true; - return await this._runContext.run({ turnAudioInput: normalizedTurnAudioInput }, async () => { + return this._runContext.run({ turnAudioInput: normalizedTurnAudioInput }, async () => { // Detect and strip !!think prefix for per-message thinking mode try { if (userMessage.startsWith('!!think ') || userMessage === '!!think') { diff --git a/src/cli/skills.test.ts b/src/cli/skills.test.ts index 8a408a2..5cc79ab 100644 --- a/src/cli/skills.test.ts +++ b/src/cli/skills.test.ts @@ -1897,7 +1897,7 @@ describe('skills CLI helpers', () => { process.exitCode = undefined; await program.parseAsync(['skills', 'registry', 'list', '--source', 'http://registry.example/catalog.json'], { from: 'user' }); - expect(errorSpy).toHaveBeenCalledWith("Registry URL must use https:// (http://registry.example/catalog.json)"); + expect(errorSpy).toHaveBeenCalledWith('Registry URL must use https:// (http://registry.example/catalog.json)'); expect(process.exitCode).toBe(1); errorSpy.mockClear(); diff --git a/src/companion/platformClients.test.ts b/src/companion/platformClients.test.ts index 67ea4f3..af72ac0 100644 --- a/src/companion/platformClients.test.ts +++ b/src/companion/platformClients.test.ts @@ -50,7 +50,7 @@ function createRuntimeMock(): { lastDisconnectCode: number | undefined; lastDisconnectReason: string | undefined; connected: boolean; -} { + } { const connect = vi.fn(async () => undefined); const disconnect = vi.fn(() => undefined); const dispose = vi.fn(() => undefined); diff --git a/src/gateway/modelCatalog.ts b/src/gateway/modelCatalog.ts index 80007a0..e2b0369 100644 --- a/src/gateway/modelCatalog.ts +++ b/src/gateway/modelCatalog.ts @@ -86,7 +86,7 @@ async function fetchJson(url: string, headers?: Record): Promise if (!response.ok) { throw new Error(`${response.status} ${response.statusText}`); } - return await response.json(); + return response.json(); } async function fetchProviderModels(provider: ModelProvider, cfg?: ModelConfig): Promise { diff --git a/src/gateway/ui/app.js b/src/gateway/ui/app.js index b27e2d9..2b767fe 100644 --- a/src/gateway/ui/app.js +++ b/src/gateway/ui/app.js @@ -100,9 +100,15 @@ export function initStatusIndicator() { const text = textMap[status] || 'Disconnected'; const color = colorMap[status] || 'bg-zinc-600'; - if (connText) connText.textContent = text; - if (connDot) connDot.className = `${baseDotClasses} ${color}`; - if (connDotMobile) connDotMobile.className = `${baseDotClasses} ${color}`; + if (connText) { + connText.textContent = text; + } + if (connDot) { + connDot.className = `${baseDotClasses} ${color}`; + } + if (connDotMobile) { + connDotMobile.className = `${baseDotClasses} ${color}`; + } } client.onStatusChange((status) => { diff --git a/src/gateway/ui/lib/pwa.js b/src/gateway/ui/lib/pwa.js index ce6bf4a..59a28e5 100644 --- a/src/gateway/ui/lib/pwa.js +++ b/src/gateway/ui/lib/pwa.js @@ -1,3 +1,5 @@ +/* global caches, Notification */ + function readGatewayToken() { const params = new URLSearchParams(window.location.search); const token = params.get('token'); diff --git a/src/gateway/ui/sw.js b/src/gateway/ui/sw.js index 02d0246..0d0aa82 100644 --- a/src/gateway/ui/sw.js +++ b/src/gateway/ui/sw.js @@ -1,3 +1,5 @@ +/* global self, caches, URL, Response */ + const CACHE_NAME = 'flynn-webchat-v5'; const token = new URL(self.location.href).searchParams.get('token'); const withToken = (path) => { diff --git a/src/skills/registrySource.ts b/src/skills/registrySource.ts index 01bdcce..1599a03 100644 --- a/src/skills/registrySource.ts +++ b/src/skills/registrySource.ts @@ -107,7 +107,7 @@ async function fetchRegistryJson(url: string, opts: SkillRegistryLoadOptions): P throw new Error(`Registry fetch failed: HTTP ${response.status}`); } - return await response.json(); + return response.json(); } export async function loadSkillRegistryCatalog( diff --git a/src/tools/builtin/audio-transcribe.ts b/src/tools/builtin/audio-transcribe.ts index 1eb2b07..c1fd51a 100644 --- a/src/tools/builtin/audio-transcribe.ts +++ b/src/tools/builtin/audio-transcribe.ts @@ -298,7 +298,7 @@ function truncateForError(text: string, max = 180): string { async function readResponseBody(response: Response): Promise { const textReader = response.text as unknown; if (typeof textReader === 'function') { - return await response.text(); + return response.text(); } const maybeJsonResponse = response as unknown as { json?: () => Promise }; diff --git a/src/tools/builtin/minio-sync.ts b/src/tools/builtin/minio-sync.ts index 3d166cd..a16e573 100644 --- a/src/tools/builtin/minio-sync.ts +++ b/src/tools/builtin/minio-sync.ts @@ -216,7 +216,7 @@ export function createMinioSyncTool(config: BackupConfig, store: MemoryStore, de return { success: true, output: [ - `MinIO sync completed.`, + 'MinIO sync completed.', `Prefix: minio://${bucket}/${prefix}`, `Scanned: ${selected.length} object(s)`, `Imported: ${imported}`,