Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add ability to ignore some peerDependencies #206

Open
roykathurima opened this issue May 17, 2022 · 4 comments
Open

Feature Request: Add ability to ignore some peerDependencies #206

roykathurima opened this issue May 17, 2022 · 4 comments

Comments

@roykathurima
Copy link

roykathurima commented May 17, 2022

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.

@roykathurima
Copy link
Author

I have opened a PR for this here: #207

@ljharb
Copy link
Collaborator

ljharb commented May 17, 2022

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.

@roykathurima
Copy link
Author

roykathurima commented May 18, 2022

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

@ljharb
Copy link
Collaborator

ljharb commented May 18, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants