Skip to content

TSConfig extends does not resolve Node.js style specifiersΒ #62753

@valler

Description

@valler

πŸ”Ž Search Terms

extends, config

πŸ•— Version & Regression Information

⏯ 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:

I have read

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions