Skip to content

tsconfig.json extends field node-style resolution broken #43245

Open
@achingbrain

Description

@achingbrain

Bug Report

The docs say (emphasis mine):

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.

This worked up until recently but is currently broken. I can't pin down a specific version where it stopped working as I guess the code that loads the config may be from a dependency of typescript that is shared across different versions.

We've got a module that contains org-wide tsconfig that we want our projects to extend - they could be regular modules, monorepo packages, etc.

Those projects can and do get pulled in as github urls (or https://gitpkg.now.sh/ urls for monorepo packages) for other modules as dependencies during PRs. Those projects are typically written in js but generate types from jsdoc comments using the npm prepare script for the current module to use, which now fails as it can't resolve the extends path.

You can't always predict which node_modules folder will contain the relevant dependency, so doing Node.js style resolution (e.g. stepping up through directories) is essential for our use-case.

🔎 Search Terms

  • tsconfig extending npm package
  • tsconfig extend node_modules
  • tsconfig node_modules
  • tsconfig extend resolve

🕗 Version & Regression Information

Not sure, it was working before Christmas, now it does not.

🙁 Actual behavior

Typescript does not resolve the extends path using Node.js style resolution.

🙂 Expected behavior

Typescript should resolve the extends path using Node.js style resolution.

References:

#18865
#30701

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThe issue relates to how you learn TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions