Repository navigation
Description
π Search Terms
extends, config
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about Common "Bugs" That Aren't Bugs
β― Playground Link
No response
π» Code
The TSConfig Reference on extends is unclear about whether the following is supported or not:
{
"extends": "@scope/package/example"
}And practical tests gave mixed results.
π Actual behavior
- Respects an external package's export map. Giving the impression Node.js specifiers are respected in general.
- Does not respect own package's export map. Giving the impression only paths syntax is respected and resolved according to Node.js resolution for relative paths.
π Expected behavior
Docs should be clear about whether
- it supports only paths, or
- Node.js specifiers in general, or
- a certain subset.
Should also be clear about whether or not compilerOptions affect extends; and if so, how.
Docs should reflect the compiler's actual behaviour or vice versa.
Additional information about the issue
Related, but not the same:
- Improve support for internal packages by resolving path aliasesΒ #58657
- tsconfig should support suffix
.jsoncΒ #43121
I have read
- https://www.typescriptlang.org/tsconfig/#extends
- https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs
- https://www.typescriptlang.org/docs/handbook/modules/theory.html#the-module-output-format
In particular, the FAQ on export maps gives the impression they are fully supported, albeit being opt-in:
Export maps aren't respected.
TypeScript's support for export maps is recent, and requires moduleResolution be set to node16, nodenext or bundler to be respected.
And as mentioned, the official reference is vague when it comes to terminology:
The value of extends is a string which contains a path to another configuration file to inherit from. The path may use Node.js style resolution.
Also:
Opened this issue, because of a VSCode issue I've opened recently: microsoft/vscode#276592, where the language tools don't align with the compiler.
Activity
RyanCavanaugh commentedon Nov 13, 2025
The docs there are out of date relative to advancements in node. "Node.js-style" means CommonJS-like and CommonJS doesn't reflect export maps.
valler commentedon Nov 14, 2025
On my end the
extendsresolution takes export and import maps into account. And as it turns out, it does in general. I have updated OP accordingly. One can even do things like{ "extends": "#base-config" }.Ryan Cavanaugh (@RyanCavanaugh) Would you recommend opening issues like these at the Web Repo instead, when it is (more) obvious to be a documentation issue? I'm asking, because some of OPs questions remain open, but at this point I'm pretty sure it is due to undocumented features, not due to implementation bugs.
RyanCavanaugh commentedon Nov 14, 2025
Either is fine for docs issues.
Can you clarify what the problem you're seeing is? I can't tell what the action on this issue is
valler commentedon Nov 15, 2025
By now, it's just the docs, but at the same time I really don't want to bike shed about wording. Basically it has all the info, so I'm going to close this issue. Thanks for clarifying
fix(tsconfig): optimize TsconfigPathsPlugin and fix extends resolutioβ¦