Skip to content

[Proposal] Lint rule or analyzer code for unresolved DartDoc symbols, post @docImport introduction #56878

@navaronbracke

Description

@navaronbracke

With the new @docImport feature, I was looking for a way to have unresolved doc references be flagged, since we now have an extra option of dealing with this problem.

We do have #55414 for a similar case: Warn when a doc import is unused.

However, it would be nice if we had a rule for unresolved doc references in DartDoc.
For example:

/// This class references an unresolved class [Bar].
class Foo {}

This would warn on [Bar] not being found. It could suggest either:

  • adding a @docImport
  • importing the library normally
  • fixing the reference if it was a typo or if the symbol no longer exists (which could be the case if docs were not updated)

I think that if we implement something like this, it could be very helpful for the quality of DartDoc in IDE's.

I'm not sure if this should become a code in the analyzer (like the issue mentioned above) or a lint rule.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onlegacy-area-analyzerUse area-devexp instead.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions