Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upRule suggestion: Forbid cyclic dependencies #1119
Comments
This comment has been minimized.
This comment has been minimized.
|
This sounds great. Happy to try enabling this in a future version of |
feross
added this to the
standard v12 milestone
Apr 27, 2018
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Jul 27, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
Jul 27, 2018
This comment has been minimized.
This comment has been minimized.
michael-ciniawsky
commented
Jul 27, 2018
|
... |
stale
bot
removed
the
stale
label
Jul 27, 2018
feross
modified the milestones:
standard v12,
standard v13
Aug 28, 2018
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Nov 26, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
Nov 26, 2018
This comment has been minimized.
This comment has been minimized.
|
On Tue, Nov 27, 2018, 6:14 AM stale[bot] ***@***.*** wrote:
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1119 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALycKlyUX1lNSG_XIDZ_QvmVG1XNqK8ks5uzHXtgaJpZM4Tqw72>
.
|
stale
bot
removed
the
stale
label
Nov 27, 2018
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
Feb 25, 2019
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
Feb 25, 2019
This comment has been minimized.
This comment has been minimized.
|
Would still like to see this If anyone wants to make a PR against the config repo, and compile a report of how many repositories this would break, that would be awesome |
stale
bot
removed
the
stale
label
Feb 25, 2019
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
May 26, 2019
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
May 26, 2019
This comment has been minimized.
This comment has been minimized.
|
Would still like to see this If anyone wants to make a PR against the config repo, and compile a report of how many repositories this would break, that would be awesome |
dtinth commentedApr 27, 2018
•
edited
I looked in the Issues board for
standardandeslint-config-standardproject but did not find anything related to this, so I decided to start a new issue.While circular dependencies are useful in some cases, based on my experience, it more often than not led to very tightly coupled modules, which are very painful to refactor. In my opinion, it would be a great idea if dependency cycles could be prevented from the start.
Moreover, in a large project with 1,000’s of files and multiple developers, without always checking, it’s easy even for very experienced programmers to inadvertently create a dependency cycle, leading to errors such as “MyModule.myFunction is not a function,” caused by MyModule being partially executed due to being involved in a dependency cycle.
Prior art
Go language does not support cyclic dependencies at all.
Having debugged cyclic dependency problems several time in a large project, I used to say, “If a project is written in Go, we could hire any Go programmer and they will never cause a single dependency cycle, no matter how junior they are!”
Airbnb’s style also forbids dependency cycles.
Implementation
It can be added by using import/no-cycle rule (ES6 import) or dependencies/no-cycle rule (require / import / export).
Impact
Cons:
Pros:
standardand don’t have to worry about someone create cyclic deps, without having to jump through hoops and switch to standardx or eject to ESLint.