Skip to content

fix(build): exclude test files from production tsc check#62

Merged
robinebers merged 2 commits intomainfrom
robinebers/fix-panel-footer-types
Feb 3, 2026
Merged

fix(build): exclude test files from production tsc check#62
robinebers merged 2 commits intomainfrom
robinebers/fix-panel-footer-types

Conversation

@robinebers
Copy link
Owner

@robinebers robinebers commented Feb 3, 2026

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 tsc validates 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, and src/test/** from the root tsconfig.json typecheck.

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.

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>
@macroscopeapp
Copy link

macroscopeapp bot commented Feb 3, 2026

Exclude test files from production TypeScript compile in tsc by updating tsconfig.json

Add an exclude array in tsconfig.json to skip src/**/*.test.ts, src/**/*.test.tsx, and src/test/** during production tsc.

📍Where to Start

Start with the exclude configuration in tsconfig.json.


Macroscope summarized 51fd422.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@robinebers robinebers merged commit 430f1b9 into main Feb 3, 2026
3 checks passed
@robinebers robinebers deleted the robinebers/fix-panel-footer-types branch February 3, 2026 13:16
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.

tauri build fails on main due to TypeScript errors in panel-footer.test.tsx (missing PanelFooterProps about props)

1 participant