Skip to content

Config to silence all peer dependency warnings #4835

@TravisJRyan

Description

@TravisJRyan

Describe the user story
As a developer, I want to migrate a number of projects to pnpm from previously using npm 7 with the legacy-peer-deps flag. There are many peer dependency warnings which I know are safe, and I want a common configuration to silence these warnings to decrease noise on install without having to explicitly list all the missing peers / mismatch version issues in each repository. It would be nice if there were one flag to silence all of these.

This is how npm operates with the legacy-peer-deps flag so it can be seen as an equivalent feature when coupled with strict-peer-dependencies=false.

Describe the solution you'd like
A config silence-peer-warnings for the .npmrc peer dependencies settings which would skip peer dependency warnings altogether, exactly like npm with the --legacy-peer-deps flag. It should likely only work if strict-peer-dependencies is false.

Describe the drawbacks of your solution
The major drawback is choosing to use this flag generates risk for the user, which is why it would need to be opt-in.

Describe alternatives you've considered
We could support pattern matching in peerDependencyRules. This could make it easier to control peer dependency ignores without the danger of a blanket ignore flag, such as any react* peer dependency being okay to ignore, etc. The downside is the pattern matching could confuse users and alter the already understood API for these rules. It may need to be a new property which would clutter and complicate the understanding of the logic.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions