-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dependency cycle detected import/no-cycle #2061
Comments
That is indeed a dependency cycle, so it's a bug that it wasn't warning on it before. |
Was really a bug before? import type from { ... } it was allowed. Anyway, thank you for your answer. |
No, anything that causes two files to depend on each other is a cycle, and is a horrifically bad architecture, which is the purpose of the rule to prevent. |
Sorry, @ljharb, but this is wrong. The purpose of this rule is to avoid possible issues at runtime with circular dependencies. Using At the very least, it should be configurable to exclude The makers of Madge know and understand that. In any case, this has rendered this check useless for me because of this, which is actually really unfortunate. So, turning this rule off and integrating Madge into CI flow. |
I agree that there’s a difference between avoiding runtime and build time cycles, and I’d be fine adding an option that allows type cycles. However, |
An option would be great – I would love to have this rule included. And I have a feeling that this has broken eslint for a lot of people ❤️ As for In the documentation for
However, there is a very poorly worded section:
It can lead to the impression that If you're good with a flag, I'm happy to take a look and send over a pull request |
As @raycharius commented, this definitely is a breaking change for many projects since the rule now flags a recommended pattern in Redux where the root state type is inferred by TypeScript from imported reducers.
EDIT: This has apparently been fixed earlier today by #2083. Thanks for the fix, @cherryblossom000! 🎉 |
Hello,
After an update from '2.22.1' to '2.23.0' I have this error
I'm trying to import a TypeScript Type like this:
./Bar.ts
./useBar.ts
Previously import type even if it was cycled import worked.
The text was updated successfully, but these errors were encountered: