-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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.