[Feature] Support `yarnclean` functionality via resolutions or config
See original GitHub issue- I’d be willing to implement this feature (with some guidance perhaps, I’m not familiar with the berry codebase)
- This feature can already be implemented through a plugin
Describe the user story
Some important dependencies have malformed dependency lists and bring in transitive packages that can break builds. The example I have in mind is @types/styled-components
, which brings in @types/react-native
, which clashes with DOM typings built into TypeScript.
In Yarn v1, I could add @types/react-native
to .yarnclean
, and that dependency would not be be installed. This only makes a single repository work though.
Describe the solution you’d like
Perhaps there’s a way to block dependencies from being included in the current package and downstream dependencies
e.g.
"dependencies": {
"@types/styled-components": "^5.3.1",
},
"resolutions": {
"@types/react-native": null
}
or
"dependencies": {
"@types/styled-components": "^5.3.1",
},
"excludeDependencies": ["@types/react-native"]
Describe the drawbacks of your solution
An extension like this would be yarn-specific, and npm clients would still have that extension drawn into their workspace.
Additional context
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33015
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:9 (9 by maintainers)
I guess you could try with aliasing it to the normal react types.
Is this a problem in both PnP and node_modules or?
The workaround did work in my projects - it’s not the most straightforward of configs, but it lets me use the types I want to use. I’ll leave this issue open as a suggestion for more direct approaches to problems like that