-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Web: Fix circular dependency warnings for discover and access list #32940
Comments
Let's also inspect the difference in time it takes to run ESLint after enabling |
Cyclic imports can lead not only to bad design, but sometimes they might impede enabling certain features of TypeScript or bundlers, see #47694.
However, just enabling import/no-cycle makes To be honest, I'd be fine with this perf hit as I think the benefits far outweigh it. vite-plugin-circular-dependency works only during build time. This would mean that a developer wouldn't learn about a cyclic dep until the app was built, but we don't even do this in CI yet (#45056). The dev server seems to ignore errors provided by the plugin. But even then, seeing the error only during the CI check is still better than not seeing it at all. The main problem here is that we'd first need to set up the CI to run app builds. |
@gzdunek I'm also not sure how effective both solutions presented here would be at preventing new "invalid" imports across packages, e.g. importing stuff from Because of the way our project is structured, adding such an import doesn't technically create a cyclic dep, as our individual packages in |
If we enable project references for each package, then TypeScript will take care of cross package imports. I will copy myself from the the other PR:
Another thing that comes to my mind is disabling TS paths and just import from |
We can curb cyclic deps by adding |
|
Add the eslint rule
'import/no-cycle': [2, { ignoreExternal: true }]
and get rid of circular dependecy's forThe text was updated successfully, but these errors were encountered: