ci(types): type-check test files via tsconfig.tests.json, non-blocking first (#3962)#3985
Conversation
…g) (#3962 task 1.2) 283 pre-existing mock/signature-drift errors baselined; flip the CI steps to blocking when the count reaches 0. Full strict kept (see epic doc for why noImplicitAny stays on and tests/ dir is excluded). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AphLfgUJWaFNAgU5UXdJ4n
|
Claude finished @Yeraze's task —— View job PR Review: ci(types): type-check test files via tsconfig.tests.jsonTasks:
Overall AssessmentThis is a well-structured, pragmatic addition. The approach (non-blocking first, document the flip condition explicitly, gate to one matrix leg) is the right way to introduce a new quality gate against an existing error backlog. The deviations from the original plan are well-reasoned and documented.
|
| Area | Status |
|---|---|
tsconfig.tests.json correctness |
✅ Sound |
noEmit duplication |
|
spec file coverage gap |
|
| CI non-blocking gate | ✅ Well-structured |
| Flip-to-blocking documentation | ✅ Clear and actionable |
| Production typecheck unaffected | ✅ Verified per PR description |
The PR achieves its stated goal cleanly. The nits above are all non-blocking — the core implementation is solid and a good step toward the remediation epic goal.
Summary
Task 1.2 of the remediation plan (#3962, Phase 1).
~557 test files currently get zero type-checking (
tsconfig.jsonexcludes**/*.test.ts*), so mock shapes silently drift from real signatures. This adds:tsconfig.tests.json— extends the root config, addssrc/**/*.test.ts(x)to the program, relaxes onlynoUnusedLocals/noUnusedParameters.npm run typecheck:testsscript.ci.yml(gated to the 24.x leg to avoid 4× matrix cost) andpr-tests.yml, each with an inline comment stating the flip-to-blocking condition (error count = 0).Baseline: 283 errors, all in test files, zero in production sources — real drift (e.g. mock
checkPermissionsignatures that no longer match, properties read off mocks that the real type doesn't have). Top ~8 files hold ~150 of them; burndown + flip-to-blocking is follow-up work.Deviations from the plan (measured, documented in the epic doc)
strictkept —noImplicitAnystays ON. The plan suggested turning it off initially; measured, that adds ~50 false-positive errors in production files (disabling evolving-any inference) while hiding real test drift. Strict-on is better on every axis: 283/0 test/prod vs 345/50.tests/dir excluded — including it pulls@types/nodeinto the whole program and poisons frontend inference (~60 spurious implicit-any errors insrc/components). Documented in the config header; it can get its own config later if wanted.Verification
npm run typecheck:tests→ 283 errors, 0 in prod files.string-into-numbermock error was caught at its exact location, then reverted (283 → 284 → 283).npm run typecheck(prod) unaffected: clean. Builds and vitest untouched.success: true).Refs #3962
🤖 Generated with Claude Code
https://claude.ai/code/session_01AphLfgUJWaFNAgU5UXdJ4n