From 6156b8e36f4ff283c05fad8e3eccee1622d1d17c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 05:24:08 +0000 Subject: [PATCH 1/3] Fix oxlint errors in simulator and test files - Replace non-null assertions with optional chaining + nullish coalescing in input-policy.test.ts - Remove useless empty fallback in spread in simulator.ts - Replace inline import() type annotation with top-level import type in runner.test.ts Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01PPrEA7jt8Y47Cewq22gMyv --- app/models/simulator.ts | 2 +- app/services/simulations/__tests__/input-policy.test.ts | 4 ++-- app/services/simulations/__tests__/runner.test.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/simulator.ts b/app/models/simulator.ts index 3455a72..3f35f87 100644 --- a/app/models/simulator.ts +++ b/app/models/simulator.ts @@ -675,7 +675,7 @@ export async function listSportsSeasonSimulatorSummaries(): Promise { expect(oddsOnly.get("longshot")?.method).toBe("sourceOdds"); // Between: a blend that sits strictly between the base and the odds-derived Elo. - const oddsElo = oddsOnly.get("favorite")!.sourceElo; + const oddsElo = oddsOnly.get("favorite")?.sourceElo ?? 0; const blended = resolveSourceElos(inputs, profile, { inputPolicy: { oddsWeight: 0.5 } }); expect(blended.get("favorite")?.method).toBe("blend"); - const blendedElo = blended.get("favorite")!.sourceElo; + const blendedElo = blended.get("favorite")?.sourceElo ?? 0; expect(blendedElo).toBeGreaterThan(Math.min(1800, oddsElo)); expect(blendedElo).toBeLessThan(Math.max(1800, oddsElo)); expect(blendedElo).toBeCloseTo(Math.round(0.5 * 1800 + 0.5 * oddsElo), 0); diff --git a/app/services/simulations/__tests__/runner.test.ts b/app/services/simulations/__tests__/runner.test.ts index f7eb9be..736468a 100644 --- a/app/services/simulations/__tests__/runner.test.ts +++ b/app/services/simulations/__tests__/runner.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; +import type * as SimulationsRegistry from "~/services/simulations/registry"; vi.mock("~/models/sports-season", () => ({ findSportsSeasonById: vi.fn(), @@ -24,7 +25,7 @@ vi.mock("~/models/scoring-calculator", () => ({ vi.mock("~/services/simulations/registry", async (importOriginal) => { // Keep the real SIMULATOR_TYPES / getSimulatorInfo so the manifest (pulled in // transitively via input-policy) can build; only stub getSimulator. - const actual = await importOriginal(); + const actual = await importOriginal(); return { ...actual, getSimulator: vi.fn() }; }); vi.mock("~/services/simulations/simulation-probabilities", () => ({ -- 2.45.3 From 8b480df98c413d57c52800084291c7b3a9e4089c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 05:25:48 +0000 Subject: [PATCH 2/3] Use Array#toSorted() instead of Array#sort() in cs2-major-stage test Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01PPrEA7jt8Y47Cewq22gMyv --- app/models/__tests__/cs2-major-stage.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/__tests__/cs2-major-stage.test.ts b/app/models/__tests__/cs2-major-stage.test.ts index 2fd6e84..79ff652 100644 --- a/app/models/__tests__/cs2-major-stage.test.ts +++ b/app/models/__tests__/cs2-major-stage.test.ts @@ -308,7 +308,7 @@ describe("resetCs2Event", () => { const recalcCalls = vi.mocked(recalculateParticipantQP).mock.calls; expect(recalcCalls).toHaveLength(2); - expect(recalcCalls.map((c) => c[0]).sort()).toEqual(["p1", "p2"]); + expect(recalcCalls.map((c) => c[0]).toSorted()).toEqual(["p1", "p2"]); for (const call of recalcCalls) expect(call[1]).toBe("season-1"); }); -- 2.45.3 From 7d34ce8f10e4529a64bc1214f980a9215971976e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 07:20:58 +0000 Subject: [PATCH 3/3] Fix TS2709: use typeof SimulationsRegistry as type argument Namespace imports must be referenced with typeof when used as a type parameter. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01PPrEA7jt8Y47Cewq22gMyv --- app/services/simulations/__tests__/runner.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/simulations/__tests__/runner.test.ts b/app/services/simulations/__tests__/runner.test.ts index 736468a..0c4f9b4 100644 --- a/app/services/simulations/__tests__/runner.test.ts +++ b/app/services/simulations/__tests__/runner.test.ts @@ -25,7 +25,7 @@ vi.mock("~/models/scoring-calculator", () => ({ vi.mock("~/services/simulations/registry", async (importOriginal) => { // Keep the real SIMULATOR_TYPES / getSimulatorInfo so the manifest (pulled in // transitively via input-policy) can build; only stub getSimulator. - const actual = await importOriginal(); + const actual = await importOriginal(); return { ...actual, getSimulator: vi.fn() }; }); vi.mock("~/services/simulations/simulation-probabilities", () => ({ -- 2.45.3