Repository navigation
fix(lint): check extension-shadowed imported files in their configured program - #1094
Conversation
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
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Performance change vs mainWorkflow run · main 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.
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)
tsrs-lintRelease
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)
|
02a128c to
6d0ba48
Compare
…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
6d0ba48 to
0f7bfa5
Compare
under a wildcard
includewith bothfoo.tsandfoo.tsxin one directory,get_file_names_from_config_specsdropsfoo.tsxfromParsedCommandLine.file_names()because.tshas higher extension priority. when another file importsfoo.tsx(e.g. underallowImportingTsExtensions),tsrs -pincludes it in the configured program, buttsrs --lintleft it unmatched infind_tsconfigand checked it in an inferred program, which lost project module augmentations (false TS7006) and options likenoUncheckedIndexedAccess(missed TS2322). fixes #1046get_file_names_from_config_specsnow records files skipped only for extension priority onParsedCommandLine(extension_shadowed_file_names).find_tsconfigmatches them only when no config includes the file directly, andlint_programchecks them in that configured program ifprogram.get_source_filecontains them, falling back to the inferred program otherwise (including when the config or program has diagnostics, without surfacing spurioustsconfig-errordiagnostics for configs the file is not part of). excluded files, files outsideinclude(left on the inferred program), and.jsfiles withoutallowJsare unaffected. discovery and headless tests cover same-stem.ts/.tsx(full project, single file, unimported fallback, config/program diagnostics) plus the excluded and.jscases