You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It only works if I run dependency-cruiser from the /packages/A folder directly. My guess is that it only picks up the tsconfig.json from the current working directory.
I only have a .dependency-cruiser.js in the root.
Is there a way to have it pick up the configs of each subfolder respectively?
Environment
Version used: 15.2.0
Node version: 18.18.0
Operating System and version: MacOS 13.3.1 (22E261)
The text was updated successfully, but these errors were encountered:
KevinSchiener
changed the title
Question: How to detect tsconfig.json per package in monorepo?
tsconfig.json path mapping "@/": ["src/*"] not working
Nov 7, 2023
KevinSchiener
changed the title
tsconfig.json path mapping "@/": ["src/*"] not working
Question: How to configure for tsconfig path mapping in yarn monorepo?
Nov 7, 2023
Hi @KevinSchiener dependency-cruiser currently directly supports one tsconfig.json. Supporting multiple ones at the same time is a future feature. It'll likely need a meaty chunk of time to implement correctly (and make it work with reasonable speed).
There are workarounds, but they will require some manual work.
Summary
I get
error not-to-unresolvable
when running in a monorepo where the packages have individual path mappings in theirtsconfig.json
.Can I configure dependency-cruiser to pick up the package
tsconfig.json
when running from the workspace root?Context
I have a yarn workspaces monorepo with different packages in
/packages/
and/apps/
. Some packages define path maps in their respectivetsconfig.json
.Example:
These mappings are not picked up by dependency-cruiser when running from the repository root and will result in errors like:
error not-to-unresolvable: package/A/src/pages/Dashboard/Dashboard.tsx → @/hooks/use-pageTitle
It only works if I run dependency-cruiser from the
/packages/A
folder directly. My guess is that it only picks up thetsconfig.json
from the current working directory.I only have a
.dependency-cruiser.js
in the root.Is there a way to have it pick up the configs of each subfolder respectively?
Environment
The text was updated successfully, but these errors were encountered: