Conversation
The build tsconfig excludes tests to keep them out of dist/, which left test files entirely unchecked by tsc. Add tsconfig.test.json (extends the base, noEmit, allowJs, includes src + tests) plus a `typecheck:test` npm script, and run it as a new CI step so test type errors fail the build. Enabling the check surfaced pre-existing type errors in tests that had drifted from the code they exercise; fix them: - graphql-client: adapt to request()'s current variables-argument signature - initiative-service: orderBy is a PaginationOrderBy string, not an object - issue-service: comment.user is nullable, use optional chaining Closes #198
✅ knip — no dead codeNo unused files, exports, types, or dependencies detected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Test files were excluded from
tsconfig.json(to keep them out ofdist/) and were therefore never type-checked bytsc. This adds a dedicatedtsconfig.test.jsonplus atypecheck:testnpm script, wired into CI, so type errors in tests now fail the build. Enabling the check surfaced pre-existing type errors in tests that had drifted from the code they exercise (therequest()variables-argument signature,orderBybeing aPaginationOrderBystring, and a nullablecomment.user), which are fixed here.Closes #198
Type of change
Checklist
npm run check:cipasses (lint + format)npx tsc --noEmitpasses (type check)npm testpasses (unit tests)Testing
npm run typecheck:test— exit 0 (now covers 68 test files that were previously unchecked; fails on injected test type errors as expected)npx tsc --noEmit— exit 0npm run check:ci— exit 0npm test— 829 tests passed across 60 filesNotes for reviewers
allowJsis enabled intsconfig.test.jsonso the tests can import the plain-CommonJS release scripts (scripts/release/*.cjs) without a declaration file;noEmitkeeps the pass check-only.