Exclude test folder from @metamask/gator-permissions-controller build artifact#7925
Open
jeffsmale90 wants to merge 1 commit intomainfrom
Open
Exclude test folder from @metamask/gator-permissions-controller build artifact#7925jeffsmale90 wants to merge 1 commit intomainfrom
@metamask/gator-permissions-controller build artifact#7925jeffsmale90 wants to merge 1 commit intomainfrom
Conversation
…ig.build.json and tsconfig.json
| ], | ||
| "include": ["../../types", "./src"] | ||
| "include": ["../../types", "./src"], | ||
| "exclude": ["./src/test"] |
There was a problem hiding this comment.
Test files lose type-checking in development tsconfig
Medium Severity
The "exclude": ["./src/test"] was added to tsconfig.json, but this file is used for editor type-checking and linting — not for builds. Every other package in this repo (assets-controller, assets-controllers, eth-json-rpc-middleware) only excludes test paths from tsconfig.build.json, never from tsconfig.json. This causes standalone test files like errors.test.ts inside ./src/test/ to silently lose type-checking in the IDE and during lint, which contradicts the PR's stated goal of only excluding the test folder from the build artifact.
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.


Explanation
Explicitly exclude /src/test from build by adding 'exclude' to tsconfig.build.json and tsconfig.json
References
Checklist
Note
Low Risk
Build-config-only change scoped to one package; risk is limited to potentially missing a non-test file that was incorrectly placed under
src/test.Overview
Updates
@metamask/gator-permissions-controllertsconfig.jsonandtsconfig.build.jsonto explicitlyexclude./src/test, preventing test sources from being picked up during local compilation and build artifact generation.Written by Cursor Bugbot for commit 59285bc. This will update automatically on new commits. Configure here.