Skip to content

fix: enable TypeScript strict mode and type-check tests in CI#7

Merged
riglar merged 1 commit into
devfrom
fix/tsconfig-strict
Jun 12, 2026
Merged

fix: enable TypeScript strict mode and type-check tests in CI#7
riglar merged 1 commit into
devfrom
fix/tsconfig-strict

Conversation

@riglar

@riglar riglar commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Third deferred item from the #3 review: strict: false disabled the entire strict family (strictNullChecks, noImplicitAny, …) across a published CLI that parses loosely-typed API responses, and test/** had zero static checking of any kind (not compiled, not linted — tsx strips types without checking them).

The burn-down turned out to be pleasantly small — 5 errors total, all now fixed:

  • upgrade.ts: DOM vs Node web-stream typing clash on Readable.fromWeb (same cast pattern the repo already uses in api-gateway.ts/expo.ts)
  • results-polling.service.ts: TestResult indexed an optional results array without NonNullable; duration_seconds needed an explicit ?? null
  • version.service.ts: resolveMaestroVersion could thread undefined through to its string return — now fails fast with a clear message if compatibility data lacks a default version

Toolchain wiring (so it stays clean)

  • tsconfig.json: strict: true + forceConsistentCasingInFileNames
  • New tsconfig.test.json + pnpm typecheck: strict tsc --noEmit over src/ and test/, added as a CI step
  • pnpm lint now covers test/ (chai's property-style assertions exempted from no-unused-expressions via a test-files override)

Test plan

  • pnpm build clean (dist compiled under strict)
  • pnpm typecheck clean (src + tests)
  • pnpm lint 0 errors
  • pnpm test 122/122 passing

This PR is also the first real test of the #6 review-permission fix — the claude-review workflow should now actually post comments here.

🤖 Generated with Claude Code

strict: false had the entire strict family off for a published binary
parsing loosely-typed API responses. The burn-down turned out to be
small — five errors:

- upgrade.ts: DOM/Node web-stream typing clash on Readable.fromWeb
  (same cast pattern already used in api-gateway.ts and expo.ts)
- results-polling: TestResult indexed an optional `results` array;
  duration_seconds needed an explicit null for absent values
- version.service: resolveMaestroVersion could carry undefined through
  to its return — now fails fast with a clear message when
  compatibility data provides no default version

Also closes the "tests get zero static checking" gap: tsconfig.test.json
type-checks src + test strictly via `pnpm typecheck` (new CI step), and
`pnpm lint` now covers test/ (with chai's property-style assertions
exempted from no-unused-expressions). forceConsistentCasingInFileNames
enabled alongside.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@riglar riglar force-pushed the fix/tsconfig-strict branch from 870598d to bb1d769 Compare June 12, 2026 20:07
@claude

claude Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@riglar riglar merged commit 369eb2a into dev Jun 12, 2026
2 checks passed
@riglar riglar deleted the fix/tsconfig-strict branch June 18, 2026 20:12
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