fix-ts-references
All of the dependencies for linked packages in monorepo should be specified in tsconfig.references
file in order to let tsc
to build packages and their dependencies in the right order within single compilation pass.
Install
yarn add fix-ts-references
Usage
npx fix-ts-references --fix
Script will do next:
With flag --fix
:
- Remove references from references list for package if dependency has been removed from
package.json
- Add new references to references list for package if dependency has been added to
package.json
- Setting
tsconfig.compilerOptions.rootDir=./src
if it is not set - Remove reference from project reference solution if package has been removed from repository
- Add reference to project reference solution if package has been added to the repository
Without flag --fix
will just show list of errors