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

Declare plugins as peer dependencies #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KamilaBorowska
Copy link

@KamilaBorowska KamilaBorowska commented Dec 27, 2023

ESLint documentation in https://eslint.org/docs/latest/extend/shareable-configs#publishing-a-shareable-config says the following:

If your shareable config depends on a plugin, you should also specify it as a peerDependency (plugins will be loaded relative to the end user's project, so the end user is required to install the plugins they need).

Fixes #19.

It may also make sense to update eslint-plugin-jest to 27, but this is too big of a change to have as a part of this pull request.

@KamilaBorowska KamilaBorowska force-pushed the declare-plugins-as-peer-dependencies branch from 8d77e76 to b7e1476 Compare December 27, 2023 20:36
ESLint documentation says the following:

> If your shareable config depends on a plugin, you should also specify
> it as a peerDependency (plugins will be loaded relative to the end
> user's project, so the end user is required to install the plugins
> they need).

Fixes preactjs#19.
@KamilaBorowska KamilaBorowska force-pushed the declare-plugins-as-peer-dependencies branch from b7e1476 to 3871f46 Compare December 27, 2023 20:37
@KamilaBorowska KamilaBorowska marked this pull request as draft December 27, 2023 20:51
@KamilaBorowska KamilaBorowska marked this pull request as ready for review December 27, 2023 21:06
@KamilaBorowska KamilaBorowska marked this pull request as draft December 27, 2023 21:11
@KamilaBorowska KamilaBorowska marked this pull request as ready for review December 27, 2023 21:17
@rschristian
Copy link
Member

rschristian commented Dec 28, 2023

peerDeps vs deps shouldn't make any difference in terms of module resolution, this is unlikely to fix #19. Their comment directing users to list plugins as peerDeps is likely in the interest of avoiding duplicates, especially with multiple versions.

As some package managers do not install peer deps by default, I see this only as a regression in behavior as now users will need to manually install the plugins this config uses.

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

Successfully merging this pull request may close these issues.

eslint-config-preact': Cannot find module 'eslint-plugin-jest'
2 participants