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

@wordpress/eslint-plugin dependencies on other eslint plugins should be peer dependencies #39810

Open
anomiex opened this issue Mar 28, 2022 · 1 comment · May be fixed by #42656
Open

@wordpress/eslint-plugin dependencies on other eslint plugins should be peer dependencies #39810

anomiex opened this issue Mar 28, 2022 · 1 comment · May be fixed by #42656
Assignees
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Package] ESLint plugin /packages/eslint-plugin [Status] In Progress Tracking issues with work in progress [Type] Code Quality Issues or PRs that relate to code quality
Projects

Comments

@anomiex
Copy link
Contributor

anomiex commented Mar 28, 2022

What problem does this address?

Having these other plugins as dependencies of @wordpress/eslint-plugin only works due to npm/yarn/pnpm "hoisting" dependencies. If this hoisting does not happen (e.g. with yarn's PnP or pnpm configured to disable the default compatibility hoisting that's intended to support broken dependencies like this), eslint does not find the depended plugins.

If a package such as @rushstack/eslint-patch is used to improve eslint's plugin loading, we can easily run into the opposite problem: if plugins used by @wordpress/eslint-plugin are also used directly, we can easily wind up with a version conflict (for example, if the local config uses eslint-plugin-prettier 4.0.0 while @wordpress/eslint-plugin is still depending on ^3.3.0).

What is your proposed solution?

Change these dependencies into peer dependencies with appropriate ranges (preferably >= rather than ^), as recommended by Eslint for sharable configs.

@gziolo gziolo added [Package] ESLint plugin /packages/eslint-plugin Needs Dev Ready for, and needs developer efforts labels Mar 28, 2022
@gziolo gziolo added this to To do in Core JS Apr 1, 2022
@gziolo
Copy link
Member

gziolo commented Apr 10, 2022

What is your proposed solution?

Change these dependencies into peer dependencies with appropriate ranges (preferably >= rather than ^), as recommended by Eslint for sharable configs.

Yes, it makes sense to follow the recommendation. We probably need to switch to npm 8/yarn/pnpm first or list them explicitly in Gutenberg to ensure that those dependencies get installed with npm 6.

@gziolo gziolo added [Type] Code Quality Issues or PRs that relate to code quality Good First Issue An issue that's suitable for someone looking to contribute for the first time labels May 7, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Package] ESLint plugin /packages/eslint-plugin [Status] In Progress Tracking issues with work in progress [Type] Code Quality Issues or PRs that relate to code quality
Projects
No open projects
Core JS
  
To do
Development

Successfully merging a pull request may close this issue.

3 participants