There are some use cases where you need to switch dependencies' to a different version (e.g. downgrading/switching to beta version, etc.). But by doing so, you maybe end up with wrong version of typings (@type/*) or incompatible version of other packages (such as Babel).
Version references are already valid within the overrides field:
{
"dependencies": {
"foo": "^1.0.0"
},
"overrides": {
// BEST, the override is defined as a reference to the dependency
"foo": "$foo",
// the referenced package does not need to match the overridden one
"bar": "$foo"
}
}
It would be nice if we also accept them in dependencies and devDependencies, making it seamlessly to update dependencies' version, without risking to break something unintended.
Motivation ("The Why")
There are some use cases where you need to switch dependencies' to a different version (e.g. downgrading/switching to beta version, etc.). But by doing so, you maybe end up with wrong version of typings (
@type/*
) or incompatible version of other packages (such as Babel).Version references are already valid within the
overrides
field:It would be nice if we also accept them in
dependencies
anddevDependencies
, making it seamlessly to update dependencies' version, without risking to break something unintended.Example
Usage with Babel:
Usage with types:
How
Current Behaviour
References