From 4ffd6731c2957b5852b05a9d071f670eab1ad38a Mon Sep 17 00:00:00 2001 From: J3vb Date: Thu, 2 Apr 2026 17:32:36 +0200 Subject: [PATCH] fix: resolve CI failures from invalid golangci-lint SHA and ESLint unknown rules Update golangci-lint-action to v9.2.0 with correct commit SHA. Change eslint-disable-next-line to oxlint-disable-next-line for oxlint-specific rules (consistent-function-scoping, prefer-add-event-listener, require-post-message-target-origin) that ESLint doesn't recognize. --- .github/workflows/ci.yml | 2 +- Client/tauri-client/src/components/FileUpload.ts | 2 +- Client/tauri-client/src/components/MessageInput.ts | 2 +- .../tauri-client/src/components/SearchOverlay.ts | 2 +- .../src/components/message-list/attachments.ts | 14 +++++++------- .../src/components/settings/AdvancedTab.ts | 6 +++--- .../src/components/settings/AppearanceTab.ts | 2 +- Client/tauri-client/src/lib/api.ts | 4 ++-- Client/tauri-client/src/lib/audioPipeline.ts | 6 +++--- Client/tauri-client/src/lib/noise-suppression.ts | 6 +++--- Client/tauri-client/src/lib/notifications.ts | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc7e5bca..e18d31ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: retention-days: 7 - name: Lint - uses: golangci/golangci-lint-action@4afd733a84b2f1a21f7c2e8a0e49adb3c0f2dbb6 # v9.0.0 + uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0 with: version: v2.11.3 working-directory: Server/ diff --git a/Client/tauri-client/src/components/FileUpload.ts b/Client/tauri-client/src/components/FileUpload.ts index b8e1d74b..ecd49660 100644 --- a/Client/tauri-client/src/components/FileUpload.ts +++ b/Client/tauri-client/src/components/FileUpload.ts @@ -48,7 +48,7 @@ export function createFileUpload(options: FileUploadOptions): FileUploadComponen let errorDiv: HTMLDivElement; let uploadAbort: AbortController | null = null; - // eslint-disable-next-line consistent-function-scoping -- co-located with its sole caller for readability + // oxlint-disable-next-line consistent-function-scoping -- co-located with its sole caller for readability function formatSize(bytes: number): string { if (bytes < 1024) return `${bytes} B`; if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`; diff --git a/Client/tauri-client/src/components/MessageInput.ts b/Client/tauri-client/src/components/MessageInput.ts index 513119f1..cccab522 100644 --- a/Client/tauri-client/src/components/MessageInput.ts +++ b/Client/tauri-client/src/components/MessageInput.ts @@ -183,7 +183,7 @@ export function createMessageInput(options: MessageInputOptions): MessageInputCo } /** Read a File as a data: URL (more reliable than createObjectURL in WebView2). */ - // eslint-disable-next-line consistent-function-scoping -- co-located with handlePasteFile for readability + // oxlint-disable-next-line consistent-function-scoping -- co-located with handlePasteFile for readability function readFileAsDataUrl(file: File): Promise { return new Promise((resolve, reject) => { const reader = new FileReader(); diff --git a/Client/tauri-client/src/components/SearchOverlay.ts b/Client/tauri-client/src/components/SearchOverlay.ts index 62deed8c..f647b0e6 100644 --- a/Client/tauri-client/src/components/SearchOverlay.ts +++ b/Client/tauri-client/src/components/SearchOverlay.ts @@ -50,7 +50,7 @@ export function createSearchOverlay(options: SearchOverlayOptions): MountableCom let searchAbort: AbortController | null = null; let lastSearchTime = 0; - // eslint-disable-next-line consistent-function-scoping -- co-located with its sole caller for readability + // oxlint-disable-next-line consistent-function-scoping -- co-located with its sole caller for readability function formatTimestamp(ts: string): string { try { const d = new Date(ts); diff --git a/Client/tauri-client/src/components/message-list/attachments.ts b/Client/tauri-client/src/components/message-list/attachments.ts index 6e8d99b9..16ebb24f 100644 --- a/Client/tauri-client/src/components/message-list/attachments.ts +++ b/Client/tauri-client/src/components/message-list/attachments.ts @@ -133,9 +133,9 @@ export function openCacheDb(): Promise { db.createObjectStore(IDB_STORE); } }; - // eslint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener req.onsuccess = () => resolve(req.result); - // eslint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener req.onerror = () => resolve(null); } catch { resolve(null); @@ -145,11 +145,11 @@ export function openCacheDb(): Promise { function closeDbAfterTransaction(tx: IDBTransaction, db: IDBDatabase): void { const close = (): void => db.close(); - // eslint-disable-next-line prefer-add-event-listener -- IDBTransaction does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBTransaction does not support addEventListener tx.oncomplete = close; - // eslint-disable-next-line prefer-add-event-listener -- IDBTransaction does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBTransaction does not support addEventListener tx.onabort = close; - // eslint-disable-next-line prefer-add-event-listener -- IDBTransaction does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBTransaction does not support addEventListener tx.onerror = close; } @@ -163,9 +163,9 @@ async function idbGet(url: string): Promise { closeDbAfterTransaction(tx, db); const store = tx.objectStore(IDB_STORE); const req = store.get(url); - // eslint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener req.onsuccess = () => resolve(typeof req.result === "string" ? req.result : null); - // eslint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener req.onerror = () => resolve(null); } catch { db.close(); diff --git a/Client/tauri-client/src/components/settings/AdvancedTab.ts b/Client/tauri-client/src/components/settings/AdvancedTab.ts index 8e17b107..6bded0eb 100644 --- a/Client/tauri-client/src/components/settings/AdvancedTab.ts +++ b/Client/tauri-client/src/components/settings/AdvancedTab.ts @@ -257,11 +257,11 @@ async function clearImageCache(): Promise { callback(); } - // eslint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener req.onsuccess = () => finish(resolve); - // eslint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener req.onerror = () => finish(() => reject(req.error)); - // eslint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- IDBRequest does not support addEventListener req.onblocked = () => { if (blockedTimer !== null) return; blockedTimer = setTimeout(() => { diff --git a/Client/tauri-client/src/components/settings/AppearanceTab.ts b/Client/tauri-client/src/components/settings/AppearanceTab.ts index 0154f27f..5b20da74 100644 --- a/Client/tauri-client/src/components/settings/AppearanceTab.ts +++ b/Client/tauri-client/src/components/settings/AppearanceTab.ts @@ -128,7 +128,7 @@ export function buildAppearanceTab(signal: AbortSignal): HTMLDivElement { const currentAccent = loadPref("accentColor", defaultAccent); - // eslint-disable-next-line consistent-function-scoping -- co-located with saveAccent for readability + // oxlint-disable-next-line consistent-function-scoping -- co-located with saveAccent for readability function applyAccent(color: string): void { // Set on both documentElement and body so the accent wins over // theme class specificity (body.theme-neon-glow sets --accent) diff --git a/Client/tauri-client/src/lib/api.ts b/Client/tauri-client/src/lib/api.ts index 445174c3..81f1e667 100644 --- a/Client/tauri-client/src/lib/api.ts +++ b/Client/tauri-client/src/lib/api.ts @@ -50,7 +50,7 @@ const log = createLogger("api"); /** Create the REST API client. */ export function createApiClient(initialConfig: ApiClientConfig, onUnauthorized?: OnUnauthorized) { - // eslint-disable-next-line consistent-function-scoping -- co-located with createApiClient for encapsulation + // oxlint-disable-next-line consistent-function-scoping -- co-located with createApiClient for encapsulation function isValidHost(host: string): boolean { return /^[\w.-]+(:\d+)?$/.test(host) && host.length <= 253; } @@ -159,7 +159,7 @@ export function createApiClient(initialConfig: ApiClientConfig, onUnauthorized?: return doFetch("Admin API", adminBaseUrl(), method, path, body, signal); } - // eslint-disable-next-line consistent-function-scoping -- co-located with doFetch for encapsulation + // oxlint-disable-next-line consistent-function-scoping -- co-located with doFetch for encapsulation async function parseError(res: Response): Promise { try { const body = await res.json(); diff --git a/Client/tauri-client/src/lib/audioPipeline.ts b/Client/tauri-client/src/lib/audioPipeline.ts index bd5024d5..69a248dc 100644 --- a/Client/tauri-client/src/lib/audioPipeline.ts +++ b/Client/tauri-client/src/lib/audioPipeline.ts @@ -298,10 +298,10 @@ export class AudioPipeline { } // Don't connect workletNode output to anything — it's analysis-only - // eslint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage + // oxlint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage workletNode.port.postMessage({ type: "config", threshold }); - // eslint-disable-next-line prefer-add-event-listener -- MessagePort does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- MessagePort does not support addEventListener workletNode.port.onmessage = (event: MessageEvent) => { if (event.data.type === "gate") { const gated = event.data.gated as boolean; @@ -396,7 +396,7 @@ export class AudioPipeline { } // Stop AudioWorklet if (this.vadWorkletNode !== null) { - // eslint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage + // oxlint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage this.vadWorkletNode.port.postMessage({ type: "stop" }); this.vadWorkletNode.disconnect(); this.vadWorkletNode = null; diff --git a/Client/tauri-client/src/lib/noise-suppression.ts b/Client/tauri-client/src/lib/noise-suppression.ts index a6a363fb..23bd3440 100644 --- a/Client/tauri-client/src/lib/noise-suppression.ts +++ b/Client/tauri-client/src/lib/noise-suppression.ts @@ -90,13 +90,13 @@ async function createWorkletPipeline( }); const initPromise = new Promise((resolve, reject) => { - // eslint-disable-next-line prefer-add-event-listener -- MessagePort does not support addEventListener + // oxlint-disable-next-line prefer-add-event-listener -- MessagePort does not support addEventListener workletNode.port.onmessage = (event: MessageEvent) => { if (event.data.type === "ready") resolve(); else if (event.data.type === "error") reject(new Error(event.data.message)); }; }); - // eslint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage + // oxlint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage workletNode.port.postMessage({ type: "init", wasmBytes }, [wasmBytes]); await initPromise; @@ -108,7 +108,7 @@ async function createWorkletPipeline( return { processedTrack: dest.stream.getAudioTracks()[0]!, destroy() { - // eslint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage + // oxlint-disable-next-line require-post-message-target-origin -- MessagePort.postMessage, not Window.postMessage workletNode.port.postMessage({ type: "destroy" }); workletNode.disconnect(); source.disconnect(); diff --git a/Client/tauri-client/src/lib/notifications.ts b/Client/tauri-client/src/lib/notifications.ts index 230198c4..a059cf8b 100644 --- a/Client/tauri-client/src/lib/notifications.ts +++ b/Client/tauri-client/src/lib/notifications.ts @@ -53,7 +53,7 @@ export function notifyIncomingMessage(payload: ChatMessagePayload): void { const channelName = getChannelName(payload.channel_id); - // eslint-disable-next-line consistent-function-scoping -- co-located with its sole caller for readability + // oxlint-disable-next-line consistent-function-scoping -- co-located with its sole caller for readability function sanitizeNotif(s: string, maxLen: number): string { // eslint-disable-next-line no-control-regex -- intentional: strip control chars from user-provided strings const cleaned = s.replace(/[\x00-\x1F\x7F]/g, "");