Closed mickdekkers closed 6 years ago
Hi.
But I'm not sure which tsconfig file this should be put in.
Do you try put typeRoots
to <project_root>/tsconfig.base.json
?
And you can re-structure your project directory such as :
<project_root>
+ node_modules/
| | @types
| : + execa/
+ packages/
| + foo
| \ bar
+ types/
| + xxx.d.ts
| + yyy.d.ts
| :
+ tsconfig.base.json <-- put typeRoots entry to this file
Hi, thanks for your reply.
I tried restructuring the project directory as you suggested and putting typeRoots
in <project_root>/tsconfig.base.json
, but it turns out I misunderstood and typeRoots
are only used to resolve /// <reference types=".." />
directives.
I used the workaround described here by putting that into <project_root>/tsconfig.json
, and my types are detected correctly now 🎉
Hey, thanks for making this example project. It's been really helpful.
There's a package I'm trying to work with (
execa
), but some of the typings are incorrect. I'd like to override the@types/execa
typings with my own types in a/package/foo/types
folder, at least temporarily. From what I understand, this should be possible through setting thetypeRoots
property in tsconfig like this:But I'm not sure which tsconfig file this should be put in. I think I've tried all of them (and restarted vscode in between) but the types in my
types
folder aren't being picked up. Where can I place thetypeRoots
property so it can be picked up by vscode and tsc when building?