Skip to content

Lint: depend_on_referenced_packages for docImports #60780

Open
@jonasfj

Description

@jonasfj

Using:

/// @docImport 'package:test/test.dart';
library;

This works fine, but if package:test isn't a direct-dependency, or if it's a dev_dependency you probably shouldn't do this in lib/.

When rendering documentation on pub.dev we don't resolve dev_dependency, the same is the case when your documentation is rendered in a hover in the IDE.

I can also see the argument that we shouldn't care about this, because functionally it doesn't matter if you do this. Though, it'll cause problems when we analyze your package for scoring, and render your documentation on pub.dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4area-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 packagelinter-lint-proposaltype-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