Skip to content

chore(tsc): fix pre-existing type-check baseline#9

Merged
ivanmaierg merged 1 commit into
mainfrom
chore/typescript-types
May 12, 2026
Merged

chore(tsc): fix pre-existing type-check baseline#9
ivanmaierg merged 1 commit into
mainfrom
chore/typescript-types

Conversation

@ivanmaierg

Copy link
Copy Markdown
Owner

Summary

  • Adds @types/node and @types/bun as devDependencies so bun run tsc --noEmit actually succeeds. Previously it reported ~120 errors across the codebase (missing process / Buffer / NodeJS.* / bun:test / Bun) which masked a real shape bug.
  • Bumps tsconfig.module from ES2022ESNext so import attributes (with { type: "json" }) compile.
  • Fixes the masked bug in src/cli/render.test.ts: the Passage fixture was missing the required reference field and the Verse was missing number: 16. Now constructs BookId via makeBookId("JHN") to respect Rule 6.
  • Adds as string casts on branded BookId values in two test files before comparing against string literals via toBe. Rule 6 bans as BookId (casting INTO the brand); casting OUT for test comparison is fine.

Test plan

  • bun run tsc --noEmit exits 0
  • bun test — 99/99 pass

Why now

Surfaced during the feat/ts-native-architecture verify phase as a pre-existing warning. Carved out as its own PR because it's unrelated to the architectural change in #8 and shouldn't add noise to that review.

Adds @types/node and @types/bun as devDependencies so the project-wide
tsc --noEmit pass actually succeeds. Previously it reported ~120 errors
across the codebase (missing process/Buffer/NodeJS namespace, missing
bun:test module, missing Bun global) which masked real type drift.

Three small follow-on fixes once the type names resolve:
- tsconfig module 'ES2022' -> 'ESNext' so import attributes
  (with { type: 'json' }) compile
- render.test.ts Passage fixture: add the missing 'reference' field
  and the missing 'number' field on the Verse (was a real shape bug
  caught only after types resolved)
- domain test assertions: 'as string' cast on branded BookId values
  before comparing against string literals via toBe

Test count: 99/99 -> 99/99 pass. tsc --noEmit: exits 0.
@ivanmaierg ivanmaierg merged commit d3b9961 into main May 12, 2026
1 check passed
@ivanmaierg ivanmaierg deleted the chore/typescript-types branch May 12, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant