Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config to silence all peer dependency warnings #4835

Closed
1 task done
TravisJRyan opened this issue Jun 1, 2022 · 1 comment
Closed
1 task done

Config to silence all peer dependency warnings #4835

TravisJRyan opened this issue Jun 1, 2022 · 1 comment

Comments

@TravisJRyan
Copy link
Contributor

TravisJRyan commented Jun 1, 2022

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.

@zkochan
Copy link
Member

zkochan commented Jun 6, 2022

We could support pattern matching in peerDependencyRules.

This sounds better. Muting these warnings is not a good solution. The peer dependency warnings are useful.

zkochan pushed a commit that referenced this issue Jul 5, 2022
Co-authored-by: Zoltan Kochan <z@kochan.io>

close #4835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants