-
Notifications
You must be signed in to change notification settings - Fork 49
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
Closed layers #245
Comments
Hi Oliver, thanks for the question. I would describe this as you want Module B to be a 'closed' layer. Import Linter doesn't currently support this but it's something I think would belong in the library at some point. The syntax might be something like this:
In other words, imports can't pass below that line unless they go via b. In the meantime there are a few options. You could look at a forbidden import contract between You could write a custom contract type to have finer-grained control over the check. Or, if you're prepared to rearchitect things a little, you could use the ports and adapters pattern so that |
Thank you for the detailed response! Would be a neat addition to the library. I'll check out the resources you recommended in the meantime :-) |
First, thank you to the mantainers of this module, seems to be doing just what I need.
Here goes my question: I have this situation
Module
A
uses moduleB
, that in turn uses moduleC
. But I want to keepA
andC
as decoupled as possible. I don't want any type defined byC
to be present inA
's code (caused byB
directly forwardingC
's response toA
).That's because I don't want a requirement change in
A
triggering a change inC
's code. Responding to changes inA
's requirements isB
responsibility.Is this something that can be enforced by import-linter? seems like a dumb question since it has nothing to do with imports, hit me with a newspaper
The text was updated successfully, but these errors were encountered: