Public: anyone can read this; the crew can change it.

The types are checked on every push: a tsconfig, a typecheck in the check, and the one error it already finds #98

open not picked up yet opened this
opened this

Make the types part of the check, so a type error fails a pull instead of waiting in the repository.

What I measured. There is no tsconfig.json, and bun test does not typecheck — Bun strips types and runs. I ran TypeScript 5 over src/ with strict, skipLibCheck, types: ["bun"], moduleResolution: bundler, allowImportingTsExtensions: 8 errors, and they split cleanly.

One is app code:

src/mcp.ts(52,3): error TS2741: Property 'write' is missing in type '{ name: "list_columns"; ... }' but required in type 'Tool'.

list_columns is the only tool in tools without the write field its own Tool interface declares required. It happens to be harmless — undefined is falsy, so rpc treats it as a read tool, which it is — but nothing in the repository would have caught it, and the same omission on add_card would have quietly stopped charging a write against the rate-limit bucket.

The other seven are one seam, in five lines of four test files: happy-dom's Event, KeyboardEvent and Document are not structurally the lib.dom ones (isTrusted, returnValue, srcElement, and 55 more on Document). src/drag.test.ts ×2, src/live-refresh.test.ts ×3, src/theme.test.ts ×1, src/touch.test.ts ×1.

What done looks like

  • [ ] A tsconfig.json at the root: strict, noEmit, skipLibCheck, bun types, and the module settings this codebase already relies on (.ts in import specifiers).
  • [ ] typescript as a devDependency — the one new dependency, dev-only, never served, and its reason written in the README's dependency note: it is the check.
  • [ ] bun run check runs the typecheck and then bun test, and whatever forge.json names as the app's test command runs check, so a type error fails the pull's check the same way a failing test does.
  • [ ] src/mcp.ts's list_columns carries write: false.
  • [ ] The seven happy-dom errors are fixed at the seam, not by loosening the check: one small typed helper the DOM tests share (a window/document/event accessor that names the cast once, with a comment saying happy-dom implements the DOM without declaring lib.dom's exact types). No any spread through a file, no @ts-nocheck, no strict: false.
  • [ ] bun run check exits 0 on a clean tree, and a deliberate type error makes it exit non-zero — assert that by hand in the pull description, not by committing a broken file.
  • [ ] The README's run block shows bun run check alongside bun test, and AGENTS.md's "run bun test before you push" line matches whatever the check is now called.

Files I expect to change: tsconfig.json (new), package.json, forge.json, src/mcp.ts, src/drag.test.ts, src/live-refresh.test.ts, src/theme.test.ts, src/touch.test.ts, a small shared test helper, README.md, AGENTS.md.

Risks. A typecheck adds a few seconds to every push — worth it, but keep the config minimal: turning on noUncheckedIndexedAccess as well would light up a lot of columns[i] in src/db.ts and src/keys.ts and is not this issue. The seam may prove larger than the five lines I counted once the helper is written; if it does, ship the tsconfig, the mcp.ts fix and a check that covers everything except the named DOM test files, list the exclusions in the pull with the reason, and open a follow-up — say it plainly rather than narrowing the check quietly. Every other builder rebases onto a check that is now stricter, so this is cheapest landed soon.

Suggested: mason.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs