From 6a4dcf8bccda9235c4ad30c5e7eb4f0d9c5d54e1 Mon Sep 17 00:00:00 2001 From: Chris Arderne Date: Thu, 13 Aug 2026 14:57:01 +0100 Subject: [PATCH] chore: fix lint warnings --- .oxlintrc.json | 5 ++++- apps/webapp/seed-queue-metrics.mts | 4 +++- .../webapp/test/dashboardAgentWatchQueueName.test.ts | 12 ++++++++++-- apps/webapp/test/helpers/sessionStream.ts | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 61e3a684a2..8ad9675e36 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -1,5 +1,8 @@ { "$schema": "./node_modules/oxlint/configuration_schema.json", + "categories": { + "correctness": "error" + }, "plugins": ["typescript", "import", "react"], "jsPlugins": [ "./oxlint-plugins/no-thrown-unawaited-redirect.mjs", @@ -32,7 +35,7 @@ "no-control-regex": "off", "typescript/no-non-null-asserted-optional-chain": "off", "no-unused-expressions": [ - "warn", + "error", { "allowShortCircuit": true, "allowTernary": true diff --git a/apps/webapp/seed-queue-metrics.mts b/apps/webapp/seed-queue-metrics.mts index 32b3e89b4d..836afd5f77 100644 --- a/apps/webapp/seed-queue-metrics.mts +++ b/apps/webapp/seed-queue-metrics.mts @@ -1,11 +1,13 @@ import { boundedIn } from "@trigger.dev/database"; import { ClickHouse } from "@internal/clickhouse"; import type { QueueMetricsRawV1Input } from "@internal/clickhouse"; -// App modules compile to CommonJS under tsx, so import them as default bindings. +// App modules compile to CommonJS under tsx, so these intentionally use default bindings. +// oxlint-disable import/default import dbServer from "./app/db.server"; import organizationServer from "./app/models/organization.server"; import projectServer from "./app/models/project.server"; import friendlyIdentifiers from "./app/v3/friendlyIdentifiers"; +// oxlint-enable import/default const { prisma } = dbServer; const { createOrganization } = organizationServer; diff --git a/apps/webapp/test/dashboardAgentWatchQueueName.test.ts b/apps/webapp/test/dashboardAgentWatchQueueName.test.ts index ecee4d3ee1..66f9b2262a 100644 --- a/apps/webapp/test/dashboardAgentWatchQueueName.test.ts +++ b/apps/webapp/test/dashboardAgentWatchQueueName.test.ts @@ -180,8 +180,16 @@ async function createFor(seeded: Seeded, spec: WatchSpec, chatId?: string) { } async function persistedQueueName(created: { watchId?: string }) { - const watch = await getWatch(ctx.agentDb, { id: created.watchId! }); - return (watch?.spec as { queue: string }).queue; + if (!created.watchId) { + throw new Error("Expected the created watch to have an ID"); + } + + const watch = await getWatch(ctx.agentDb, { id: created.watchId }); + if (!watch) { + throw new Error(`Expected watch ${created.watchId} to exist`); + } + + return (watch.spec as { queue: string }).queue; } /** The queue as `QueueRetrievePresenter` hands it to the page: the prefix already stripped. */ diff --git a/apps/webapp/test/helpers/sessionStream.ts b/apps/webapp/test/helpers/sessionStream.ts index 085c3cc4ed..9e0f4e7c86 100644 --- a/apps/webapp/test/helpers/sessionStream.ts +++ b/apps/webapp/test/helpers/sessionStream.ts @@ -274,7 +274,7 @@ export async function collectSessionOut( if (!gotNew) { await new Promise((r) => setTimeout(r, 100)); } - } while (true); + } while (true); // oxlint-disable-line no-constant-condition return { parts, durationMs: performance.now() - started, subscription }; }