Skip to content

chore: split tsconfig into app/test project references#391

Merged
nicknisi merged 5 commits intomainfrom
fix/tsconfig-test-types
Mar 20, 2026
Merged

chore: split tsconfig into app/test project references#391
nicknisi merged 5 commits intomainfrom
fix/tsconfig-test-types

Conversation

@nicknisi
Copy link
Copy Markdown
Member

Summary

  • Split tsconfig.json into solution-style project references (tsconfig.app.json + tsconfig.test.json) so the TS language server resolves Vitest globals (vi, describe, expect, Mock, MockInstance) in spec files
  • Vitest types are isolated to test files only — production code does not see them
  • Added as React.CSSProperties assertions for CSS custom properties in impersonation.tsx (pre-existing type error surfaced by the new config)
  • typecheck script now validates both app and test configs

No runtime behavior changes.

Test plan

  • pnpm run build passes
  • pnpm typecheck passes (now checks both app and test files)
  • pnpm test passes (302 tests)
  • pnpm run lint passes
  • Editor LS resolves Vitest globals in .spec.ts / .spec.tsx files

TS language server couldn't resolve Vitest globals (vi, describe,
expect, Mock) in spec files because tsconfig.json excluded them.

Split into solution-style project references so the editor resolves
types correctly while keeping test types isolated from production code.
@nicknisi nicknisi requested a review from a team as a code owner March 13, 2026 00:58
@nicknisi nicknisi requested a review from rwtombaugh March 13, 2026 00:58
Replace the global type declaration in vitest.setup.ts with explicit
imports in each spec file that uses Mock or MockInstance.
@nicknisi nicknisi requested a review from gjtorikian March 20, 2026 15:01
@nicknisi nicknisi merged commit 4eda1ea into main Mar 20, 2026
6 checks passed
@nicknisi nicknisi deleted the fix/tsconfig-test-types branch March 20, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants