Skip to content

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

Closed

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.

Activity

  1. RyanCavanaugh commented on Nov 13, 2025

    @RyanCavanaugh
    Member

    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.

  2. valler commented on Nov 14, 2025

    @valler
    Author

    On my end the extends resolution 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.

  3. RyanCavanaugh commented on Nov 14, 2025

    @RyanCavanaugh
    Member

    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

  4. added
    Needs More Info
    on Nov 14, 2025
  5. valler commented on Nov 15, 2025

    @valler
    Author

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More Info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions