-
-
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
no-cycle does not detect require()-based cycles #2702
Comments
Do you have a guide somewhere on how to do local development with this plugin? I'd like to poke around a bit, but I haven't figured out how to point eslint at a locally installed repo. Do I have to just copy the working directory into |
No, you'd use |
I have a working demo in #2706. You definitely wouldn't want to merge as-is, because I just hardcoded a The output on the demo repo above, on that branch, is now:
And as an aside, for anybody else, I got this working pretty cleanly for local development via:
|
Following up on #941, as requested here.
From my testing, the
no-cycle
rule DOES NOT DETECT circular dependencies if they are imported viarequire()
calls.This seems to be the intended behavior, however. As mentioned in this comment, I found this quote from the no-cycle docs:
However, a follow-up comment says that
require()
cycles are in fact supported, and suggested I open a new issue.As far as I can tell, the original commenter's repo on that issue shows the problem quite well:
https://github.com/simonbuchan/eslint-import-cycle-example
Clone that, then:
It should also be detecting the cycle in
require-a.js
.Am I misusing something?
The text was updated successfully, but these errors were encountered: