Skip to content

fix(lint): check extension-shadowed imported files in their configured program - #1094

Merged
maschwenk merged 2 commits into
mainfrom
fix/lint-imported-files-program
Nov 25, 2026
Merged

maschwenk merged 2 commits into
mainfrom
fix/lint-imported-files-program

Conversation

@maschwenk

@maschwenk maschwenk commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

under a wildcard include with both foo.ts and foo.tsx in one directory, get_file_names_from_config_specs drops foo.tsx from ParsedCommandLine.file_names() because .ts has higher extension priority. when another file imports foo.tsx (e.g. under allowImportingTsExtensions), tsrs -p includes it in the configured program, but tsrs --lint left it unmatched in find_tsconfig and checked it in an inferred program, which lost project module augmentations (false TS7006) and options like noUncheckedIndexedAccess (missed TS2322). fixes #1046

get_file_names_from_config_specs now records files skipped only for extension priority on ParsedCommandLine (extension_shadowed_file_names). find_tsconfig matches them only when no config includes the file directly, and lint_program checks them in that configured program if program.get_source_file contains them, falling back to the inferred program otherwise (including when the config or program has diagnostics, without surfacing spurious tsconfig-error diagnostics for configs the file is not part of). excluded files, files outside include (left on the inferred program), and .js files without allowJs are unaffected. discovery and headless tests cover same-stem .ts/.tsx (full project, single file, unimported fallback, config/program diagnostics) plus the excluded and .js cases

@codspeed

codspeed Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 3.05%

Warning

oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 1 regressed benchmark
âś… 7 untouched benchmarks
⏩ 8 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Memory drizzle-orm 98.3 MB 101.4 MB -3.05%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix/lint-imported-files-program (0f7bfa5) with main (25f67c1)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Performance change vs main

Workflow run · main 25f67c11b5ee → PR merge a986f3153c4b (head 0f7bfa5bbdf8)

Clef gate: Running benchmarks because the decision was unavailable (crates/tsrs_lint/src/engine.rs: patch exceeds the Clef context limit (9317 bytes)).

Release builds in fast mode (TSRS_FAST=1) with Hyperfine 2 hardware counters. After warming each binary, alternating main/PR pairs measure wall time at both the fast preset's default checker count and with --singleThreaded, with ten pairs per configuration by default. Instructions come from the single-threaded runs; peak RSS comes from the default-count runs.
Incremental runs start with fresh build info before every invocation; check runs disable incremental compilation.

Project Mode Single-thread wall time Δ Single-thread instructions Δ Default wall time Δ Default peak RSS Δ
vscode check +0.9% +0.001% -0.3% -0.2%
vscode incremental +1.3% -0.002% +0.8% +0.1%
xstate-main check -0.7% +0.001% -1.9% +0.3%
xstate-main incremental -0.8% +0.002% +0.2% 0.0%
webpack check 0.0% +0.014% -0.8% +0.1%
webpack incremental -0.2% +0.009% +0.8% -0.2%
mui-docs check -2.3% +0.001% +1.2% +0.4%
mui-docs incremental +0.4% +0.011% +0.6% -0.1%
Compiler check -2.3% 0.000% -2.1% -1.6%
Compiler incremental 0.0% -0.001% +2.7% +0.1%
Compiler-Unions check +4.1% -0.018% -1.0% +0.5%
Compiler-Unions incremental +1.3% +0.020% -1.0% 0.0%
cal-diy check +3.0% -0.023% -0.7% 0.0%
cal-diy incremental -0.3% -0.012% -1.2% -0.3%
formbricks-web check -0.9% +0.007% +0.3% -0.1%
formbricks-web incremental -0.9% -0.010% +0.3% -0.2%
supabase-studio check -0.2% -0.002% -0.7% -0.1%
supabase-studio incremental +0.9% +0.004% -2.1% 0.0%
t3code-server check +3.0% +0.013% +4.3% +0.8%
t3code-server incremental -2.6% -0.013% -2.9% -0.1%
mikro-orm check -0.7% +0.001% +1.9% +0.2%
mikro-orm incremental +0.8% -0.001% +0.3% +0.2%
next-packages-next check +0.1% +0.060% 0.0% -0.2%
next-packages-next incremental -0.5% 0.000% -0.2% +0.4%
next-root check -1.4% 0.000% -2.1% -0.6%
next-root incremental -1.0% +0.002% -2.9% -0.1%
storybook check 0.0% +0.006% +1.5% -0.7%
storybook incremental -0.3% +0.024% -2.8% -0.2%
nuxt check +3.9% +0.002% +3.2% +0.7%
nuxt incremental +0.5% +0.004% +3.9% 0.0%
playwright check +0.8% +0.001% +2.1% +0.3%
playwright incremental -0.4% +0.066% +0.4% -0.6%
drizzle-orm check -3.3% +0.005% -3.0% +0.6%
drizzle-orm incremental -2.1% 0.000% +1.0% -0.1%
typeorm check +3.2% -0.167% +3.5% +0.5%
typeorm incremental -0.5% +0.010% -3.3% -0.8%
date-fns check +1.6% -0.008% +0.4% -0.9%
date-fns incremental -1.2% -0.017% -0.8% -0.8%

Negative means the PR used less; positive means it used more. Deltas are medians of paired PR/main ratios for wall time and instructions. Single-threaded runs reduce scheduling noise; shared CI machines can still add noise to wall time.

Measured medians (main → PR)
Project Mode Single-thread wall time (s) Single-thread instructions Default wall time (s) Default peak RSS (MiB)
vscode check 10.684 → 10.836 82,266,379,718 → 82,267,193,325 1.745 → 1.743 1842.5 → 1839.1
vscode incremental 12.295 → 12.901 84,683,896,395 → 84,682,639,896 2.195 → 2.200 2158.6 → 2161.8
xstate-main check 0.563 → 0.555 5,566,851,897.5 → 5,566,815,955 0.141 → 0.136 241.4 → 242.0
xstate-main incremental 0.573 → 0.566 5,728,459,187 → 5,728,521,369 0.179 → 0.178 244.9 → 244.8
webpack check 1.213 → 1.207 10,885,610,576 → 10,887,142,863 0.249 → 0.248 404.3 → 404.9
webpack incremental 1.017 → 1.008 11,109,374,979 → 11,109,642,530 0.249 → 0.250 403.4 → 402.7
mui-docs check 3.805 → 3.739 33,104,806,724 → 33,105,917,076.5 1.388 → 1.418 1230.3 → 1235.3
mui-docs incremental 2.591 → 2.599 34,459,190,441.5 → 34,463,616,645.5 1.100 → 1.122 1162.4 → 1161.2
Compiler check 0.259 → 0.258 1,775,538,803.5 → 1,775,542,056.5 0.083 → 0.084 77.6 → 76.3
Compiler incremental 0.180 → 0.179 1,789,925,331 → 1,789,904,453.5 0.085 → 0.087 79.6 → 79.7
Compiler-Unions check 0.266 → 0.278 3,053,224,060.5 → 3,052,685,932 0.120 → 0.122 81.1 → 81.5
Compiler-Unions incremental 0.222 → 0.226 3,064,790,395.5 → 3,065,395,800.5 0.107 → 0.105 85.0 → 85.0
cal-diy check 2.902 → 2.944 28,976,026,584.5 → 28,968,989,265 0.842 → 0.840 1358.8 → 1358.8
cal-diy incremental 2.747 → 2.747 30,593,694,597.5 → 30,590,134,460 1.033 → 1.023 1269.9 → 1266.4
formbricks-web check 3.444 → 3.415 37,088,176,570 → 37,090,885,921 0.874 → 0.874 1582.4 → 1580.4
formbricks-web incremental 4.599 → 4.624 39,694,379,316.5 → 39,690,067,397.5 1.333 → 1.333 1624.6 → 1622.1
supabase-studio check 3.649 → 3.644 40,824,897,350 → 40,823,489,363.5 0.952 → 0.947 1310.0 → 1309.0
supabase-studio incremental 4.527 → 4.523 43,772,143,301.5 → 43,772,493,799.5 1.237 → 1.231 1363.1 → 1363.0
t3code-server check 4.560 → 4.700 41,058,151,949 → 41,063,401,491 2.040 → 2.076 1441.0 → 1451.9
t3code-server incremental 4.557 → 4.485 41,585,089,882.5 → 41,577,917,159 1.843 → 1.843 1306.8 → 1306.0
mikro-orm check 5.879 → 5.797 44,485,401,514.5 → 44,485,900,508.5 1.222 → 1.216 1281.6 → 1283.5
mikro-orm incremental 5.226 → 5.272 44,796,465,015 → 44,796,198,240.5 1.285 → 1.307 1256.6 → 1258.8
next-packages-next check 1.781 → 1.803 17,406,343,440.5 → 17,416,760,130 0.471 → 0.450 561.0 → 559.9
next-packages-next incremental 1.612 → 1.613 17,732,813,736 → 17,732,769,395 0.462 → 0.460 563.8 → 565.9
next-root check 1.689 → 1.682 13,996,300,267 → 13,996,341,129.5 0.343 → 0.346 433.0 → 430.5
next-root incremental 1.397 → 1.338 14,459,044,410.5 → 14,459,040,691 0.323 → 0.316 473.3 → 472.9
storybook check 0.823 → 0.831 8,867,636,093.5 → 8,868,137,639.5 0.226 → 0.222 398.5 → 395.5
storybook incremental 1.086 → 1.105 9,192,925,312 → 9,196,947,021.5 0.325 → 0.309 375.7 → 375.0
nuxt check 1.367 → 1.415 8,502,297,218 → 8,502,411,948 0.366 → 0.397 386.2 → 388.9
nuxt incremental 0.905 → 0.907 8,905,011,303.5 → 8,905,410,040 0.245 → 0.262 391.7 → 391.8
playwright check 0.712 → 0.718 7,403,339,531.5 → 7,403,492,659.5 0.202 → 0.204 363.1 → 364.2
playwright incremental 0.731 → 0.731 7,576,793,440.5 → 7,581,792,640.5 0.233 → 0.230 341.5 → 339.6
drizzle-orm check 0.745 → 0.721 5,948,547,630 → 5,948,834,927 0.237 → 0.230 375.9 → 378.1
drizzle-orm incremental 0.658 → 0.641 6,120,222,919.5 → 6,120,408,947 0.192 → 0.195 345.5 → 345.0
typeorm check 1.001 → 0.997 6,398,405,883 → 6,387,686,835 0.257 → 0.274 226.1 → 227.2
typeorm incremental 0.757 → 0.756 6,776,089,894.5 → 6,776,705,199.5 0.204 → 0.200 234.5 → 232.6
date-fns check 0.332 → 0.336 3,352,612,821 → 3,352,216,422.5 0.096 → 0.096 154.0 → 152.7
date-fns incremental 0.497 → 0.491 3,590,298,162 → 3,589,535,166.5 0.233 → 0.232 163.6 → 162.3

tsrs-lint

Release tsrs-lint linting each project's source files with all 61 rules. After a warmup run of each binary, alternating main/PR pairs (10 per mode) measure wall time, CPU time and peak RSS with TSRS_FAST unset and with TSRS_FAST=1.

Project Mode Wall time Δ CPU time Δ Peak RSS Δ Diagnostics (main → PR)
webpack default -2.5% +0.3% -0.1% 35405, identical
webpack TSRS_FAST=1 -0.7% +0.2% +0.1% 35405, identical
drizzle-orm default -4.4% -3.4% +0.1% 7057, identical
drizzle-orm TSRS_FAST=1 -1.6% -4.8% -0.2% 7057, identical
xstate-main default -4.5% -3.7% -0.5% 6489, identical
xstate-main TSRS_FAST=1 -0.7% +0.7% -0.5% 6489, identical

Negative means the PR used less. Wall and CPU time deltas are medians of paired PR/main ratios; peak RSS compares medians.

Measured lint medians (main → PR)
Project Mode Wall time (s) CPU time (s) Peak RSS (MiB)
webpack default 0.432 → 0.415 2.160 → 2.138 465.7 → 465.1
webpack TSRS_FAST=1 0.421 → 0.422 2.094 → 2.106 464.7 → 465.3
drizzle-orm default 0.271 → 0.270 1.418 → 1.435 403.6 → 403.9
drizzle-orm TSRS_FAST=1 0.270 → 0.265 1.454 → 1.376 404.2 → 403.3
xstate-main default 0.414 → 0.414 1.833 → 1.812 343.6 → 341.8
xstate-main TSRS_FAST=1 0.416 → 0.397 1.813 → 1.792 342.4 → 340.6

@maschwenk
maschwenk force-pushed the fix/lint-imported-files-program branch from 02a128c to 6d0ba48 Compare November 25, 2026 17:34
@maschwenk maschwenk changed the title fix(lint): check imported files missing from tsconfig fileNames in their configured program fix(lint): check extension-shadowed imported files in their configured program Nov 25, 2026
…d program

When a directory contains both foo.ts and foo.tsx under a wildcard include, get_file_names_from_config_specs
drops foo.tsx from ParsedCommandLine.file_names() because .ts has higher extension priority. If another file
imports foo.tsx, tsrs -p checks it in the configured program, while tsrs --lint fell back to an inferred program
without project compiler options or module augmentations.

Record wildcard-matched files skipped only for extension priority on ParsedCommandLine and let find_tsconfig match
them when no config includes the file directly. lint_program then checks them in that configured program if the
built program imports them, and otherwise falls back to the inferred program.

Fixes #1046
@maschwenk
maschwenk force-pushed the fix/lint-imported-files-program branch from 6d0ba48 to 0f7bfa5 Compare November 25, 2026 20:00
@maschwenk
maschwenk marked this pull request as ready for review November 25, 2026 20:01
@maschwenk
maschwenk enabled auto-merge November 25, 2026 20:01
@maschwenk
maschwenk added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 9fb8d5a Nov 25, 2026
20 of 28 checks passed
@maschwenk
maschwenk deleted the fix/lint-imported-files-program branch November 25, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

tsrs --lint: imported files omitted from tsconfig root fileNames (e.g. foo.tsx alongside foo.ts) fall into an inferred program

1 participant