Skip to content

Add a warning similar to UNUSED_IMPORT for doc imports that are unused. #55414

Open
@kallentu

Description

@kallentu

Currently, you can add doc imports to any library whether or not it's used in any references.

/// @docImport 'libb.dart'; // unused and has no warning
library a;

/// Test doc comment
class A {}

It would be nice to have it report UNUSED_IMPORT or UNUSED_DOC_IMPORT when the doc import isn't being used for any reference resolving so we can avoid unnecessary doc imports (and also see that it will actively be used).

cc. @srawlins @goderbauer

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codestype-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