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
This feature can already be implemented through a plugin
Describe the user story
While dependency cycles work, they should be avoided as they might cause race conditions between packages publishes and when the modules are loaded (if they both have side effects depending on the other).
Describe the solution you'd like
Yarn should warn in this case, similar to what lerna already does (see jestjs/jest#9712 for example output).
Describe the drawbacks of your solution
It's not always a problem. In Jest's specific case it's not, but it'd still be nice if yarn at least warned of this as I think it's a pattern that should be discouraged and Yarn is in a unique position to discover this.
If we want to do this check for the whole dependency graph (i.e. including packages outside of your own monorepo), I don't think I have a workaround for that now. But if we just need to scan for circular dependencies for workspaces within your monorepo, you can use something like:
Describe the user story
While dependency cycles work, they should be avoided as they might cause race conditions between packages publishes and when the modules are loaded (if they both have side effects depending on the other).
Describe the solution you'd like
Yarn should warn in this case, similar to what
lerna
already does (see jestjs/jest#9712 for example output).Describe the drawbacks of your solution
It's not always a problem. In Jest's specific case it's not, but it'd still be nice if yarn at least warned of this as I think it's a pattern that should be discouraged and Yarn is in a unique position to discover this.
Describe alternatives you've considered
I looked into https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-cycle.md but that's for "local" modules.
Additional context
N/A
The text was updated successfully, but these errors were encountered: