fix(cli): match lint test-file exclusion relative to scan root#490
Merged
Conversation
isTestFile substring-matched "/tests/" against the absolute path, so any ancestor directory named tests (e.g. ~/Developer/tests/my-app) classified every file in the project as a test file and silently disabled all includeTests:false rules (no-variants-in-prod, no-as-any). Match against the path relative to the scan root with path-segment boundaries instead, so only the project's own test files and tests/ dirs are excluded. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Contributor
|
Contributor
📦 Bundle size reportCompared against ✅ No size changes vs the baseline.
|
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 783 KB | 273 KB |
| Type declarations | 284 KB | 97 KB |
| Source maps | 1.5 MB | 510 KB |
| Other | 11 KB | 3.7 KB |
| Total | 2.6 MB | 883 KB |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
85 KB | 2.5 KB | 88 KB | external | 279 KB |
./beta |
40 KB | 231 B | 40 KB | external | 119 KB |
./type-generator |
19 KB | 0 B | 19 KB | external | 54 KB |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 81 KB |
. |
utils.js |
initial | 4.0 KB |
. |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./beta |
beta.js |
initial | 30 KB |
./beta |
databricks.js |
initial | 5.8 KB |
./beta |
service-context.js |
initial | 3.2 KB |
./beta |
client-options.js |
initial | 220 B |
./beta |
databricks.js |
lazy | 128 B |
./beta |
index.js |
lazy | 103 B |
./type-generator |
index.js |
initial | 19 KB |
@databricks/appkit-ui
npm tarball (packed): 295 KB — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 350 KB | 116 KB |
| Type declarations | 201 KB | 72 KB |
| Source maps | 669 KB | 218 KB |
| CSS | 16 KB | 3.3 KB |
| Total | 1.2 MB | 410 KB |
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
./js |
4.3 KB | 49 KB | 54 KB | 208 KB | 12 KB |
./js/beta |
20 B | 0 B | 20 B | 0 B | 0 B |
./react |
428 KB | 49 KB | 476 KB | 1.3 MB | 163 KB |
./react/beta |
20 B | 0 B | 20 B | 0 B | 0 B |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
./js |
index.js |
initial | 4.2 KB |
./js |
chunk |
initial | 120 B |
./js |
apache-arrow |
lazy | 49 KB |
./js/beta |
beta.js |
initial | 20 B |
./react |
index.js |
initial | 426 KB |
./react |
tslib |
initial | 2.1 KB |
./react |
apache-arrow |
lazy | 49 KB |
./react/beta |
beta.js |
initial | 20 B |
Trim the isTestFile WHY comment to one line and let biome reflow the lintFile signature to multi-line. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
atilafassina
approved these changes
Jul 23, 2026
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.
Problem
appkit lint'sisTestFilesubstring-matched"/tests/"against the absolute file path:Any ancestor directory named
tests— e.g. an app scaffolded under~/Developer/personal/tests/my-app— makes every file in the project match, so it's treated as a test file. Rules markedincludeTests: false(no-variants-in-prod,no-as-any) are then silently skipped for the entire project, andappkit lintreports no violations even when they exist.This defeats the
no-variants-in-prodguardrail exactly where it matters: a leftover dev-only<Variants>block can ship to production while the lint stays green, purely because of an unlucky (and common) parent directory name.Fix
Match against the path relative to the scan root, with path-segment boundaries, instead of a substring of the absolute path.
rootDiris threaded fromrunLint→lintFile→isTestFile.Verification
tsc --noEmiton the changed file: clean.Behavioral before/after:
tests/ancestor (…/personal/tests/app/src/Foo.tsx)true(bug)false✓src/foo.spec.tsx)truetrue✓tests/dir (tests/smoke.ts)truetrue✓src/App.tsx)falsefalse✓Reproduced originally by scaffolding an app under a
tests/parent directory and observingno-variants-in-prodnever fire on a real<Variants>block in the app source.