Repository navigation
fix(tsoptions): key literal files entries by their absolute path - #1021
Merged
camc314 merged 1 commit intoNov 18, 2026
Merged
Conversation
`get_file_names_from_config_specs` stored each literal `files` entry in `literal_file_map` under the key of the raw spec text (`a.ts`), but every later lookup uses the key of an absolute file name. So the lookups never matched a literal entry. Go `getFileNamesFromConfigSpecs` (`tsconfigparsing.go:1883`) keys the map by `validatedFileNames[i]`, the absolute name, and tsrs now does the same. There were two effects: - If `files` names `a.ts` and `include` matches only a sibling with a lower extension priority (`a.d.ts`, or `a.js` with `allowJs`), tsgo drops the sibling. tsrs put it in the program, so the diagnostics and the exit code changed. - If a file is in `files` and also matches `include` (or two `files` entries spell one path, such as `a.ts` and `./a.ts`), tsrs added the root file again. `--explainFiles` and the diagnostics that print "The file is in the program because:" (for example TS6059) repeated the line `Part of 'files' list in tsconfig.json`. Reported in oxc-project#1010. Tests: the regression cases `files-literal-dts-sibling` and `files-and-include-overlap-rootdir`, with expected output from tsgo at the pinned commit. Both fail without the fix. AI assistance: written with Claude Code. Co-authored-by: Kyoungjun Min <7831054+kjmin-dev@users.noreply.github.com>
Contributor
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
camc314
approved these changes
Nov 18, 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.
What and why
With
"files": ["a.ts"]and"include": ["*.d.ts"], tsrs includeda.d.ts, which tsgo skips. This hid TS2304 in the reproduction in #1010. Overlappingfilesandincludeentries, or twofilesentries for one path, also repeated thePart of 'files' listreason.literal_file_mapused the raw spec text as its key, but the later lookups use absolute paths, so they never found a literal file. It now uses the absolute file name, as GogetFileNamesFromConfigSpecsdoes. This is the fix that @kjmin-dev found and suggested in #1010; this PR adds regression tests for it.Closes #1010
Evidence
files-literal-dts-siblingandfiles-and-include-overlap-rootdir, with expected output from tsgo: both fail onmainand pass with the fix.tools/regressions.sh: 56/56 pass.tsrs_tsoptionstests: 57 passed, 1 ignored.recycle_checkers: passed.tsrs_tsoptions,cargo fmt --checkandnode tools/lint/source.mjs: clean.tsrs-test run --suite all --timeout 300: the same 13,696 tests pass as onmain.AI assistance: written with Claude Code.
Co-authored-by: Kyoungjun Min 7831054+kjmin-dev@users.noreply.github.com