Standing rule: use every tool's type safety to the maximum extent available
Context
tools/browser_check.mjs (decision 0012) was written in plain JavaScript. The user flagged this as a project-wide concern, not a one-off nitpick: wherever a tool offers type safety, this project should use it to the maximum extent possible, and asked for the browser-check script specifically to be translated accordingly, researched and chosen deliberately rather than defaulted to.
Options considered
Decision
tools/browser_check.mjs was rewritten as tools/browser_check.ts. Its documented invocation now always includes `deno run --check ...` (not bare `deno run`, which strips TypeScript types without checking them) so a type error actually blocks execution rather than being silently ignored. Going forward, any new standalone tooling script in this project should default to TypeScript-under-Deno (or Gleam, where a native/bound library actually exists for the task, per decision 0009's precedent) rather than plain JavaScript, unless a concrete reason rules it out.
Verification
`deno check tools/browser_check.ts` passes clean. The rewrite caught one real latent issue plain JS had silently allowed: Playwright's `Locator.boundingBox()` types as `BoundingBox | null` (element might not be found/visible), and the original script dereferenced `box.x` without checking for null -- now handled explicitly. Re-ran the full script end-to-end after the rewrite (`deno run --check ...`): identical behavior to the .mjs version, PASS with real rendered pixel counts and click-to-spawn confirmed.
Consequences
The one Deno-side DOM-typing wrinkle worth remembering: `page.evaluate()` callbacks execute inside the real browser page, but Deno's own ambient types have no DOM lib (server-side runtime) -- needs a file-scoped `/// <reference lib="dom" />` directive (not a global deno.json compilerOptions change, which would also apply to -- and risk affecting how `gleam test --target javascript` treats -- Gleam's own generated JS output, since deno.json is shared project-wide). Any future page.evaluate-based script in this project should expect the same fix.