Open roykathurima opened 2 years ago
I have opened a PR for this here: https://github.com/nathanhleung/install-peerdeps/pull/207
This shouldnāt be supported. Two packages is a much much better way to manage this - itās why the Airbnb config has two packages.
Yeah, we were tryna avoid publishing multiple packages. coz we'll potentially have 3 packages; one for JS, one that extends Js to provide TS support and finally one that extends the TS one to provide react support. If we make changes and bump the base package then we'll need to bump the base-package versions on the other two packages. Plus the packages are really small since they are just extending airbnb config and then overriding a few rules, just felt like an overkill separating them out just because there are some peer deps we do not need.
I know this' a real edge case š and I guess we can figure out something in house. š Anyway, thanks for the comment and feel free to close this issue and its associated PR :D
The proper granularity here is definitely āpackageā. Yes, i understand via maintaining the Airbnb config that this can be annoying, but itās far better than the alternative.
Context
We are writing a eslint config that can be used to lint react and non-react projects (also ts and non-ts apps). I know we could write and publish them as different packages each with its own package.json and publish them individually to npm. However, we have one package with all the config separated into different files, each with a specific purpose i.e., only lints JS or TS or react.
Challenge
The challenge comes when installing the peerdeps; if we only want to use the TS-specific config, we do not need to pull react-specific stuff. So we need a way to omit these deps while installing the package.
Possible approach
Allow removing deps with certain keywords, i.e., a user can run
npx install-peerdeps --omit-with-keywords="react, typescript" PACKAGE_NAME
. The keywords can be a list of comma-separated values.