TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

TSConfig cannot extend from a module in TypeScript 4.8

Open quisido opened this issue 2 years ago • 3 comments

🔎 Search Terms

extends, custom, tsconfig

🕗 Version & Regression Information

This feature worked in TypeScript 4.7.4, but does not work in 4.8.0.

⏯ Playground Link

N/A

💻 Code

In TS <= 4.7, you could use the following code in tsconfig.json, to extend the config located at @scope/some-package/tsconfig.json:

{
  "extends": "@scope/some-package"
}

In TS 4.8, this now throws an error "File '@scope/some-package' not found."

🙁 Actual behavior

The following error is thrown: "File '@scope/some-package' not found."

🙂 Expected behavior

The config @scope/some-package/tsconfig.json should be extended.

quisido avatar Sep 19 '22 05:09 quisido

I'm going to need a bigger repro, because given only what's set out here, an extends referencing literally @scope/some-package with a tsconfig.json at node_modules/@scope/some-package/tsconfig.json, works just fine, both on main and in release-4.8.

weswigham avatar Sep 21 '22 16:09 weswigham

at node_modules/@scope/some-package/tsconfig.json

Maybe it's an issue with Yarn berry. 😵 I'm using Yarn 3, but again this works in 4.7. If I install typescript@~4.7.0, this error goes away.

quisido avatar Sep 21 '22 20:09 quisido

yarn berry patches ts on install, so their patch might not apply correctly to 4.8 or something. Unless you can repro w/o yarn, good chance it's yarn's fault.

weswigham avatar Sep 21 '22 22:09 weswigham