From 447ea256329e0adf967269ffb035c3364697a616 Mon Sep 17 00:00:00 2001 From: Lucas Winther Date: Thu, 20 Aug 2026 06:11:26 +0200 Subject: [PATCH] build: let tsc find the bindings nothing reads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This project has no linter and does not want one, but `strict` says nothing about a binding that is simply never read — and that is the one kind of dead code a reader cannot tell apart from a deliberate seam. `tsc` already walks every file, so it may as well answer the question. Three had accumulated: an unread `type View` import in App, and a `useGameMeta()` resolver in Controls and YourOwn, both of which draw their colours from somewhere else — the game-order list has its own resolver, and YourOwn reads the reader's own records directly. None of them were wrong, they were just leftovers that read as intent. Co-Authored-By: Claude Opus 5 (1M context) --- AGENTS.md | 9 ++++++++- src/client/App.tsx | 2 +- src/client/components/Controls.tsx | 1 - src/client/components/YourOwn.tsx | 2 -- tsconfig.json | 2 ++ 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6387d8a..77c19af 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,7 +66,14 @@ feed is a static JSON file built from snapshots, falling back to checked-in fixt The only runtime dependency is `zod`. Do not add a bundler, test runner, HTTP client, or HTML parsing library — Bun covers all four. `tsconfig.json` runs `strict` plus -`noUncheckedIndexedAccess` and `exactOptionalPropertyTypes`. +`noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`, `noUnusedLocals` and +`noUnusedParameters`. + +The last two are there because this project has no linter and does not want one: a binding nothing +reads is the only kind of dead code a reader cannot tell from a deliberate seam, and `tsc` already +walks every file. Three had accumulated behind `strict` — an unread `type View` import, and a +`useGameMeta()` resolver in two components that each draw their colours from somewhere else. A +genuinely unused parameter is spelled with a leading underscore, which both flags already exempt. ## Commands diff --git a/src/client/App.tsx b/src/client/App.tsx index f8c811e..23fa0b4 100644 --- a/src/client/App.tsx +++ b/src/client/App.tsx @@ -17,7 +17,7 @@ import { useAppUpdate } from "./state/useAppUpdate.ts"; import { useMarkSet } from "./state/useMarkSet.ts"; import { useProgress } from "./state/useProgress.ts"; import { useDailyLog, type DailyLogMap } from "./state/useDailyLog.ts"; -import { adoptNewLanes, usePrefs, type View } from "./state/usePrefs.ts"; +import { adoptNewLanes, usePrefs } from "./state/usePrefs.ts"; import { snapDayWidth } from "./state/zoom.ts"; import { useCustom } from "./state/useCustom.ts"; import { compareRows, SORT_MODES, type Activity, type SortMode } from "./state/sort.ts"; diff --git a/src/client/components/Controls.tsx b/src/client/components/Controls.tsx index 589dcc4..60cf717 100644 --- a/src/client/components/Controls.tsx +++ b/src/client/components/Controls.tsx @@ -65,7 +65,6 @@ export function Controls({ /** Everything the reader entered themselves, and the ways to change it. */ own: React.ComponentProps; }) { - const gameMeta = useGameMeta(); return (
{/* Which games and how they are read on one side, what the reader has diff --git a/src/client/components/YourOwn.tsx b/src/client/components/YourOwn.tsx index 163fb8a..96ab07c 100644 --- a/src/client/components/YourOwn.tsx +++ b/src/client/components/YourOwn.tsx @@ -1,6 +1,5 @@ import { useState } from "react"; import type { CustomEvents, CustomGames, LaneId } from "../../shared/custom.ts"; -import { useGameMeta } from "../state/gameMeta.tsx"; import type { EventDraft } from "../state/useCustom.ts"; import { EventForm, GameForm } from "./CustomForms.tsx"; @@ -30,7 +29,6 @@ export function YourOwn({ onRemoveGame: (id: string) => { removed: boolean; blockedBy: number }; onAddEvent: (draft: EventDraft) => void; }) { - const gameMeta = useGameMeta(); const [adding, setAdding] = useState<"game" | "event" | null>(null); const [editing, setEditing] = useState(null); const [refusal, setRefusal] = useState(null); diff --git a/tsconfig.json b/tsconfig.json index d5ac3ec..bd55ac3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,8 @@ "noEmit": true, "strict": true, "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, "noImplicitOverride": true, "noFallthroughCasesInSwitch": true, "exactOptionalPropertyTypes": true,