-
Notifications
You must be signed in to change notification settings - Fork 251
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
Matching against transitive dependencies (enhance reachable
rules)
#763
Labels
enhancement
this will make dependency-cruiser sweeter
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
sverweij
added
enhancement
this will make dependency-cruiser sweeter
and removed
stale
labels
Apr 16, 2023
This was referenced Dec 24, 2023
sverweij
added a commit
that referenced
this issue
Dec 25, 2023
…BREAKING for API users) (#895) ## Description - Same as #888, but for the path detection algorithm underlying 'reaches' and 'reachable' rules The addition to the _rule_ will be in a separate PR ## Motivation and Context - fixing #763 - this PR is a prerequisite to implement the feature requested in there - feature parity with similar restrictions on cycles ## How Has This Been Tested? - [x] green ci - [x] updated automated regression tests - [x] dog-fooding on dependency-cruiser ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] Documentation only change - [ ] Refactor (non-breaking change which fixes an issue without changing functionality) - [x] New feature (non-breaking change which adds functionality) - [x] Breaking change (fix or feature that would cause existing functionality to change) => for API only ## Checklist - [x] 📖 - My change doesn't require a documentation update, or ... - it _does_ and I have updated it - [x] ⚖️ - The contribution will be subject to [The MIT license](https://github.com/sverweij/dependency-cruiser/blob/main/LICENSE), and I'm OK with that. - The contribution is my own original work. - I am ok with the stuff in [**CONTRIBUTING.md**](https://github.com/sverweij/dependency-cruiser/blob/main/.github/CONTRIBUTING.md).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
I am trying to figure out where my application is importing a very heavy npm module that should only imported by code that is behind a dynamic
import
andReact.lazy
, but for some reason it's getting bundled into the main index.js bundle.Now eventually I'll find it, but I'd love to declare a rule to prevent this from happening again. I can catch if it is directly imported:
and I can catch when it is loaded transitively:
but I cannot use
reachable: true
in combination withdynamic: false
or with other qualifiers. (And it's not clear howdynamic: false
would be interpreted unless combined with a qualifier like "all modules in the via chain", "some modules in the via chain", "no modules in the via chain")Expected Behavior
I'd like to be able to match against the
via
modules, like:Current Behavior
I can either catch transitive imports or static imports, but not static transitive imports.
Possible Solution
Considered alternatives
Make all transitive imports forbidden and use
ignore-known
... but first I gotta catch the one that's already in my app.The text was updated successfully, but these errors were encountered: