Skip to content

Warn when a package is referenced and is not a direct dependency #122

@steinybot

Description

@steinybot

I would like an option to warn when something is referenced and it is not listed as a direct dependency and is instead being pulled in transitively.

This causes all kinds of problems when updating libraries that then pull in different versions of a transitive or even more unexpectedly when removing a direct dependency that shares a transitive dependency with another and then the version changes. Lock files don't help here, they only help when it is a direct dependency which this option would help to enforce.

This is the exact opposite of #108.

I come from Scala where we have this sbt build plugin that enforces explicit and no unused dependencies: https://github.com/cb372/sbt-explicit-dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions