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

Question: Restrict Imports Out of Directory Containing Config File #628

Open
JRagone opened this issue Jun 28, 2022 · 2 comments
Open

Question: Restrict Imports Out of Directory Containing Config File #628

JRagone opened this issue Jun 28, 2022 · 2 comments
Labels

Comments

@JRagone
Copy link

JRagone commented Jun 28, 2022

Summary

This is a little similar to #330, but I think it's more straightforward. Though I'm not much of a regex wizard, so I can't distinguish between this being impossible or just not clear to me.

I'd like to be able to restrict imports from going outside of the directory containing .dependency-cruiser.js. Say I have the following situation:

module
  |
   \
    submodule (containing .dependency-cruiser.js)

module depends on submodule, but nothing in submodule should depend on module or really anything outside submodule. It's no problem if submodule depends on children, grandchildren, etc.

Is there a way to accomplish this with regex?

Context

I'm working with some polyrepos. These repos are deployed as services. But some of these repos are submodules in other repos.

I'd like to prevent developers from importing outside the submodule, because the environment where the repo is used as a submodule doesn't match the repo's isolated deployment environment.

Environment

  • Version used: 11.11.0
  • Node version: 16.x
  • Operating System and version: macOS Monterey 12.11
@github-actions
Copy link

github-actions bot commented Jul 6, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jul 6, 2022
@JRagone
Copy link
Author

JRagone commented Jul 6, 2022

I'll assume this isn't possible—I'm using monorepo-cop to meet this need for the moment.

@sverweij sverweij added bug something is not working as expected question and removed stale bug something is not working as expected labels Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants