Skip to content

"depend_on_referenced_packages" and "dev_dependencies" #60026

@RohitSaily

Description

@RohitSaily

Dart SDK version: 3.8.0-24.0.dev (dev) (Wed Jan 22 12:05:43 2025 -0800) on "macos_x64"

Problem

The linter rule depend_on_referenced_packages requires that referenced packages are listed under dependencies of the user package's pubspec.yaml. Understandably, by default it is does not count a package as referenced if it is listed under dev_dependencies because that dependency will not be accessible at runtime.

I have a development dependency that I use throughout my code that simply provides annotations for development-time that are not necessary at runtime. If I want to use the linter rule to enforce explicit dependencies, I have to silence the check for this rule at every import of that dependency. I would like to not have to do that all the time; the development dependency is used by every file.

Proposed Solution

Provide a way to explicitly list select development dependencies as being depended on in analysis_options.yaml so this linter rule can be suppressed for those specific dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions