Skip to content

chore(tsconfig): typecheck scripts/ and tests/, then exhaustively type NAME_KINDS/DIR_KINDS #337

Description

@dean0x

Finding

Two related pre-existing typescript findings:

  1. typescript-5: scripts/ and tests/ are never type-checked — tsconfig.json:18's include is src/** only, so type errors in scripts/ and tests/ are invisible to any typecheck gate.
  2. typescript-6: NAME_KINDS/DIR_KINDS in tests/mds-variants.test.ts:195,198 are subset-typed (not exhaustively checked against the full Kind union).

Why deferred together

typescript-6's fix (satisfies Record<Kind,true>) only bites once a typecheck gate actually covers tests/** — i.e. once typescript-5 is fixed. Landing typescript-6 alone would add a stricter type annotation that no CI step verifies. They must land together.

Why deferred (not fixed in PR #334)

Pre-existing before this PR. Adding a check-only tsconfig plus a typecheck gate that covers scripts/** and tests/** is likely to surface an unknown backlog of existing type errors across tests/**, which is out of scope for a plumbing-only phase PR (#334, Tracker Phase 1).

Suggested fix

  1. Add a check-only tsconfig.json (or a second include scope) covering scripts/** and tests/**, wired into a typecheck script/gate in package.json.
  2. Fix whatever backlog of type errors that gate surfaces in tests/**/scripts/**.
  3. Once the gate is green, change NAME_KINDS/DIR_KINDS in tests/mds-variants.test.ts:195,198 to satisfies Record<Kind,true> so a future Kind addition is caught at typecheck time instead of silently falling out of sync.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech-debtTechnical debt items to address

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions