-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
- I'd be willing to implement this feature (contributing guide)
- This feature is important to have in this repository; a contrib plugin wouldn't do
Describe the user story
As a developer, I want to overwrite the version number of a peer dependency in a nested package, so that Yarn will stop warning that the installed version of the dependency doesn't satisfy the requested version, but will still check the peer dependency using the new version number I've specified.
Describe the solution you'd like
I can think of a few options, each having its own set of potential drawbacks:
- Create a new
peerResolutions
field. - Allow
resolutions
to replacepeerDependencies
as well asdependencies
. - Allow
packageExtensions
to overwrite existing peer dependencies, maybe with a new syntax where I provideversion: XXX
andoverwrite: true
.
Describe the drawbacks of your solution
- More fields to support.
- I'm not sure, actually. It feels like this would be safe, but I have to imagine there's some reason it doesn't already work this way.
- More syntax to support, potentially dangerous, fundamentally changes the purpose of
packageExtensions
.
Describe alternatives you've considered
I haven't had any success ignoring the mismatched peer dependencies using peerDependenciesMeta
, nor trying to adjust them with resolutions
; neither seems to work.
I could use logFilters
to discard matching messages, but that's not much of a solution, and doesn't suppress the warning "Some peer dependencies are incorrectly met".