Skip to content

Work towards enabling the comment_references lint #192870

Open

Description

@szakarias

The comment_references lint is currently disabled in analysis_options_common.yaml:

# - comment_references # blocked on https://github.com/dart-lang/linter/issues/1142

That reference is stale: linter#1142 is closed.

The comment_references lint reports doc comment references that the analyzer cannot resolve in the lexical scope of the file they appear in.

Most of these references still render as working links today, because dartdoc falls back to a universal scope — a global lookup of every element it has loaded — when lexical resolution fails. That fallback is what dartdoc wants to remove (dart-lang/dartdoc#4283). This means that references relying on it will eventually stop resolving. Enabling the lint is how we find them before that happens.

I am fixing the existing reports in separate PRs, grouped by the kind of change involved.

Material and Cupertino are frozen in this repository and their code has been copied to flutter/packages (#188444), so those files are excluded here. The same work will be needed in material_ui and cupertino_ui.

Enabling the lint is a longer-term goal. At least one category cannot be fixed immediately: a library referred to by its bare name, such as [widgets], cannot be expressed with @docImport as it currently works (dart-lang/sdk#56528).

The individual PRs are worth landing regardless — each makes references resolve in the IDE as well as in the generated documentation — so they don't depend on when the lint is finally enabled.

PRs so far:

Activity

  1. self-assigned this
    on Sep 16, 2026
  2. added a commit that references this issue on Sep 18, 2026
  3. goderbauer commented on Sep 29, 2026

    @goderbauer
    Member

    This is exciting! For context, some prework for this happened in #150800.

  4. added a commit that references this issue on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions