Open srsudar opened 1 year ago
Alternatively I could just ignore all non-top-level imports, but I don't think there's a way to do this.
Ah, it looks like some older answers to issues might be out of date now that madge uses depenceny-tree
? It looks like I can ignore all dynamically imported modules using detectiveOptions
, as described here.
"amd": {
"skipLazyLoaded": true
}
Some dynamic imports might still be problematic, so some per-usage vetting would still be of interest.
Is it possible to skip specific requires/imports via a directive? For example, say that I have something like:
foo.js
:bar.js
I believe this will not give runtime errors, though it will still be a circular dependency.
I'm trying to use
madge
in a large codebase where resolving all circular deps immediately is impractical. As an incremental way of progressing, I'd like to enable madge but mark some imports as safe. Afaict, the only way to do this is via theexcludeRegExp
value in the config. I could do the following to exclude these dirs:package.json
However, that will continue to remove those files from checking even if they are modified, and unsafe dependencies are added. I'd prefer a way to tell madge "I've vetted this import, don't worry about it." Is such a thing possible? I'm imagining something like:
Is there some way to do this that I'm missing?