Skip to content

New lint for doc imports #59741

Open
Open
@FMorschel

Description

@FMorschel

After a small discussion on both #59724 and #59723 I feel like we could have a lint that suggests converting a normal import into a doc import if it is not being used anywhere else besides doc comments. Maybe to remove a doc import if it is already imported normally too? Something like organize_doc_imports (if it does the second part if not, prefer_doc_imports is probably better) or something (name suggestions are appreciated).


@bwilkerson wrote on #59722 (comment):

we're essentially not adding any new lints at this time that aren't requested by the language team, typically in order to facilitate adoption of new language features.

I'm unsure if this is "a new language feature" and if this is important enough to be considered (and I'm not from the language team hahaha) but I'm fine with waiting.

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-linterIssues with the analyzer's support for the linter packagetype-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