fix(build): exclude test files from production tsc check#62
Merged
robinebers merged 2 commits intomainfrom Feb 3, 2026
Merged
Conversation
The build command (tsc && vite build) type-checked test files alongside source code, so any test-only type error would break production builds. Exclude *.test.ts(x) from tsconfig.json since vitest handles test type-checking independently. Closes #55 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Exclude test files from production TypeScript compile in
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="tsconfig.json">
<violation number="1" location="tsconfig.json:30">
P2: The exclude patterns don't cover the test setup file at `src/test/setup.ts`. This file imports test-only modules like `vitest` and `@testing-library/*`, meaning type errors there would still break production builds. Consider adding `"src/test/**"` to the exclude array to fully exclude test infrastructure files.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
The test setup file (src/test/setup.ts) imports vitest and @testing-library/*, so it needs to be excluded alongside test files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Prevents test-only type errors from breaking production builds. The build command runs
tsc && vite build, and previously type-checked test files alongside source code. Test files are already type-checked independently by vitest.Fixes #55
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com
Note
Low Risk
Low risk config-only change that affects which files
tscvalidates during builds; main risk is inadvertently skipping a non-test file that matches the excluded patterns.Overview
Prevents production builds (
tsc && vite build) from failing due to test-only TypeScript errors by excluding*.test.ts,*.test.tsx, andsrc/test/**from the roottsconfig.jsontypecheck.Test files remain expected to be type-checked via the separate Vitest workflow.
Written by Cursor Bugbot for commit 51fd422. This will update automatically on new commits. Configure here.
Summary by cubic
Exclude .test.ts, .test.tsx, and src/test/ from the production TypeScript check so test and test-setup type errors no longer fail tsc && vite build. Tests continue to be type-checked by Vitest.
Written for commit 51fd422. Summary will update on new commits.