`references` are not inherited in `tsconfig.json`
See original GitHub issueTypeScript Version: 3.1.0-dev.20180914
Search Terms: tsconfig.json extends references inheritance
It seems that the references
key is not inherited via the extends
mechanism, which surprised me because the handbook doesn’t mention anything special about it.
Demo:
tsconfig.base.json
:
{
"references": [
{ "path": "./some/other/project" }
],
"compilerOptions": {
"declaration": true,
"composite": true
}
}
tsconfig.doesnt-work.json
:
{
"extends": "./tsconfig.base.json"
}
Building tsconfig.doesnt-work.json
doesn’t build the reference:
$ tsc -b -f -d tsconfig.doesnt-work.json
[11:12:13] A non-dry build would build project 'C:/demo/tsconfig.doesnt-work.json'
tsconfig.works-but-duplicates-references.json
:
{
"extends": "./tsconfig.base.json",
"references": [
{ "path": "./some/other/project" }
],
}
This is a correct build but I had to duplicate the references
key:
$ tsc -b -f -d tsconfig.works-but-duplicates-references.json
[11:12:13] A non-dry build would build project 'C:/demo/tsconfig.works-but-duplicates-references.json'
[11:12:13] A non-dry build would build project 'C:/demo/some/other/project/tsconfig.json'
Issue Analytics
- State:
- Created 5 years ago
- Reactions:44
- Comments:15 (2 by maintainers)
Top Results From Across the Web
TSConfig Reference - Docs on every TSConfig option
The value of extends is a string which contains a path to another configuration file to inherit from. The path may use Node.js...
Read more >Why is a Typescript project reference using the parent tsconfig ...
Just to put some context to my question: I'd like to move several projects to a single monorepo, but not all the code...
Read more >tsconfig.json
By invoking tsc with no input files, in which case the compiler searches for the tsconfig.json file starting in the current directory and...
Read more >TypeScript project references | moon
tsconfig.options.json . This file will contain common compiler options that will be inherited by all projects in the monorepo. For project references to ......
Read more >Angular compiler options
A TypeScript configuration can inherit settings from another file using the extends property. ... When true , does not produce .metadata.json files.
Read more >Top Related Medium Post
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is the intended behavior but we need to document it
In the handbook it says:
Following the principle of lease surprise,
references
should also inherit and overwrite those from the base config file.Regarding what Ryan said:
Is it still impossible if we allow
references
to override even if it’s empty?