In our monorepo utilizing Lerna, we have two packages - package a and package b - both containing @types/react.
Package A is dependent on Package B, resulting in the following structure:
Package A: node_modules/PackageB/node_modules/@types
This setup leads to numerous duplicate errors.
At the moment, we are not using any workspaces and rely on NPM. During TSC compilation for type checking, we encounter multiple errors related to duplicate and missing packages.
I was wondering if there is a way to specify the types folder I want to utilize in the tsconfig file? Instead of fetching all types, can I instruct it to only retrieve node_modules/@types without going into nested directories?
I've experimented with typesRoot, types, and paths configurations, but haven't had any success yet. Currently, we're resorting to skipLibCheck, although it's not an ideal solution.