Skip to content

Map: strict TypeScript #400

Done
4 of 4 issues completed
Done

Description

@jtklein-agents

Destination

A ready-for-agent spec ticket whose children end with "strict": true in tsconfig.json, the now-redundant noImplicitAny, noImplicitThis and strictBindCallApply lines removed, and yarn typecheck passing with no new @ts-ignore or @ts-expect-error. An implementer can pick up each child without asking anything else.

Notes

  • Settled while charting:
    • The destination is a spec, run like Spec: Electron build and runtime packages current on a spec/<n>-… feature branch.
    • One tsconfig. Test files (*.test.ts(x), src/test/, e2e/helpers) are held to strict too.
    • Type-only changes are in scope (narrowing, guards that keep behavior). A real bug that strict mode exposes and whose fix changes what the user sees is filed as its own bug issue, not fixed here.
    • Rollout: children fix one area at a time with strict still off, each checked with an ad-hoc tsc --noEmit -p tsconfig.json --strict limited to its files; the last child flips the flag. No typescript-strict-plugin, no second tsconfig.
    • Non-null assertions: production code narrows for real and uses ! only with a one-line why comment; tests may use !.
  • Starting point (2026-11-27, at 2dbadc8): --strict gives 149 errors. 141 come from strictNullChecks (about 100 in tests; production hot spots src/app/store/Alignment.ts, Run.ts, Option.ts, PartOptions.ts, InputFile.ts), the rest from strictFunctionTypes (ipcMain.handle handlers typed IpcMainEvent in src/main/api.ts, the RunList listener, src/test/setup.ts, and the App.tsx/AlignmentCard.tsx prop errors from option setValue variance). strictPropertyInitialization and useUnknownInCatchVariables add nothing.
  • Mechanical fixes (IPC event types, proc.stdout null, paths.ts, modelSelection.ts, StoreBase optional call) need no decision ticket; they go straight into the spec's slices.
  • Grilling tickets use the grilling and domain-modeling skills. Read docs/agents/checks.md for the typecheck and docs/agents/spec-branch.md for the spec branch.

Decisions so far

Not yet specified

(none: slicing graduated into a ticket)

Out of scope

  • noUncheckedIndexedAccess, exactOptionalPropertyTypes, and other flags beyond strict.
  • Dropping allowJs/checkJs (no JS left in src/); may ride along in the final child if trivial, but nothing here waits on it.
  • Enforcing the ! convention with @typescript-eslint/no-non-null-assertion; a possible small follow-up.
  • Behavior fixes for real bugs strict mode exposes; each becomes its own bug issue.

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:map

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions