@types/styled-components
should be an optional peerDep and not a dependency
#2894
Labels
@types/styled-components
should be an optional peerDep and not a dependency
#2894
Description
Since
@types/styled-components
is a dependency of@primer/react
it's installed transitively, with a non-fixed version for consumers, which means that different manners of installing or instally the same packages at different times can resolve the version such that the types in a consuming application can break, even though they work fine for other installations.In dotcom, we've recently noticed this https://github.com/github/github/pull/259218#discussion_r1103645591 where an explicit install of a library with a higher version dependency on types/styled-components, caused the resolution for all code to use that newer dep.
it would be clearer to force typescript consumers to take a direct dependency on
@types/styled-components
similar to what we do withstyled-components
to ensure that a consistent version can be resolved between various installsSteps to reproduce
...
Version
latest
Browser
No response
The text was updated successfully, but these errors were encountered: