Skip to content

ci: make typecheck job actually type-check the project - #217

Merged
aleksdotbar merged 1 commit into
mainfrom
fix/ci-typecheck-build-mode
Jul 24, 2026
Merged

ci: make typecheck job actually type-check the project#217
aleksdotbar merged 1 commit into
mainfrom
fix/ci-typecheck-build-mode

Conversation

@aleksdotbar

@aleksdotbar aleksdotbar commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Problem

The CI typecheck job ran tsc --noEmit. In non-build mode, tsc does not follow project references, and the root tsconfig.json declares "files": []. Result: the command type-checks zero files and exits 0 regardless of type errors anywhere in src.

Every type error since this config landed was invisible to CI — caught only by a developer running tsc -b locally (via pnpm build). This is how type-breaking changes have reached main green (e.g. the missing csrfToken Session fixtures fixed in #216).

Proof

Injecting const x: number = "s" into src/auth/types.ts:

  • tsc --noEmit (old CI command) → exit 0, error missed
  • tsc -b (build) → exit 2, error caught

tsc --noEmit --listFiles loads 0 files from src.

Fix

typechecktsc -b, so the job type-checks the same project graph as the build. noEmit: true in tsconfig.app.json keeps it emit-free.

🤖 Generated with Claude Code

@aleksdotbar
aleksdotbar requested a review from a team as a code owner July 24, 2026 07:31
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Authentication test alignment

Layer / File(s) Summary
Typecheck command
package.json
The typecheck script now runs tsc -b.
CSRF-aware authenticated fixtures
src/api/*.test.*, src/auth/use-viewer.test.ts, src/components/auth-gate.test.tsx, src/components/widgets/v2/*.test.tsx
Authenticated test state now includes csrfToken: "csrf-1" across API, auth, and widget tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: cyberantonz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating CI typecheck behavior to actually check the project.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-typecheck-build-mode

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

typecheck ran `tsc --noEmit`, which in non-build mode ignores project
references. The root tsconfig lists `"files": []`, so the command
type-checked zero files and every type error in `src` (including tests)
passed CI silently — caught only by a local `tsc -b` in the build.

Switch to `tsc -b` so the typecheck job checks the same graph as the
build. `noEmit` in tsconfig.app.json keeps it emit-free.

Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
@aleksdotbar
aleksdotbar force-pushed the fix/ci-typecheck-build-mode branch from 3474916 to a83fbc9 Compare July 24, 2026 07:40
@aleksdotbar
aleksdotbar merged commit 99d52ce into main Jul 24, 2026
6 checks passed
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.

2 participants