From 5ccaeca890672d10ffa07094f13d41736ad9a340 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 17 Aug 2026 10:02:58 +0200 Subject: [PATCH] bucket_catch: fix typecheck so build works and eslint runs npm run build and npm run lint were both failing at HEAD on two errors: TS2769 vitest 4 no longer contributes `test` to vite's defineConfig, so the /// directive had gone inert TS6133 an unused `const { result } =` in usePuzzleGameLoop.test.ts Because lint is `tsc --noEmit && eslint src`, the failing tsc short-circuited the &&, so eslint had never actually run on this package. Fixing tsc unmasks 45 pre-existing eslint errors across 10 files -- 18 no-non-null-assertion, 10 unbound-method, 9 non-nullable-type-assertion-style, and a tail. Those need per-site judgment and are NOT fixed here; lint still exits 1 on them. So this does not make lint green. It makes build work (52 modules, was failing) and makes the eslint failures visible instead of hidden behind a short-circuit. Coverage unchanged at 583/217/97/534, which is what proves the config is still read after changing its import. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY --- .../packages/frontend/src/hooks/usePuzzleGameLoop.test.ts | 2 +- bucket_catch/packages/frontend/vite.config.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bucket_catch/packages/frontend/src/hooks/usePuzzleGameLoop.test.ts b/bucket_catch/packages/frontend/src/hooks/usePuzzleGameLoop.test.ts index 4a24e90..81a360f 100644 --- a/bucket_catch/packages/frontend/src/hooks/usePuzzleGameLoop.test.ts +++ b/bucket_catch/packages/frontend/src/hooks/usePuzzleGameLoop.test.ts @@ -228,7 +228,7 @@ describe("usePuzzleGameLoop", () => { // Use large canvas so piece doesn't collide on first tick const canvas = makeCanvas(800, 600); // basketY=520; piece reaches it at tick~190 - const { result } = renderHook(() => + renderHook(() => usePuzzleGameLoop( makeRef(canvas), makeRef(500), // far from x=48 → piece will miss diff --git a/bucket_catch/packages/frontend/vite.config.ts b/bucket_catch/packages/frontend/vite.config.ts index 6111597..2a3148b 100644 --- a/bucket_catch/packages/frontend/vite.config.ts +++ b/bucket_catch/packages/frontend/vite.config.ts @@ -1,5 +1,7 @@ -/// -import { defineConfig } from "vite"; +// vitest 4 no longer contributes the `test` key to vite's own defineConfig, so +// the config is typed by importing defineConfig from vitest/config instead of +// the (now inert) triple-slash reference. +import { defineConfig } from "vitest/config"; import react from "@vitejs/plugin-react"; export default defineConfig({