dependency_validator icon indicating copy to clipboard operation
dependency_validator copied to clipboard

Support Doc Imports

Open Conrad598 opened this issue 7 months ago • 1 comments

Dart 3.8.0 added Doc Imports which:

enables external elements to be referenced in documentation comments without actually importing them

Currently, dependency_validator doesn't appear to consider these doc imports as usages. So, if a package is imported only in Doc Imports and not in regular imports, dependency_validator will detect it as unused. I think these only need to be declared as a dev_dependency, despite being in lib/.

In practice, it might be rare for packages to have doc comment references to packages that they don't actually depend on.

Conrad598 avatar Jun 12 '25 17:06 Conrad598

Hey @Conrad598, thanks for the issue!

Yea, I think that'd be a good update, but unfortunately our team is focused on other things at the moment.

If this is something you're interested in, feel free to create a PR and I'd be happy to review it, otherwise it might be a bit until we can get to this

matthewnitschke-wk avatar Jun 12 '25 17:06 matthewnitschke-wk