TypeScript
TypeScript copied to clipboard
TSConfig cannot extend from a module in TypeScript 4.8
🔎 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.
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
.
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.
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.