Skip to content
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 not best practice #270

Closed
AidenFaulconer opened this issue Feb 21, 2020 · 1 comment
Closed

dependency cycle not best practice #270

AidenFaulconer opened this issue Feb 21, 2020 · 1 comment

Comments

@AidenFaulconer
Copy link

AidenFaulconer commented Feb 21, 2020

In this file we can see we require logger ('./../config/logger') which is a workaround from getting a dependency cycle warning, since logger is required in index.js as well (the entry point). Thus forming a dependency cycle.

Is this best practice? Would this cause an incomplete import from happening if this boilerplate was expanded upon in some instances?

@danielfsousa
Copy link
Owner

danielfsousa commented Sep 13, 2020

We should avoid dependency cycles, there is an eslint rule to prevent this: https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-cycle.md

This issue will be fixed on version 2, you can follow the progress on #334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants