Skip to content

fix: override eslint-react-hooks-plugin#161

Merged
justlevine merged 3 commits into
developfrom
fix/eslint-plugin-react-hooks-conflict
Apr 21, 2025
Merged

fix: override eslint-react-hooks-plugin#161
justlevine merged 3 commits into
developfrom
fix/eslint-plugin-react-hooks-conflict

Conversation

@Swanand01
Copy link
Copy Markdown
Contributor

What

This PR resolves a conflict caused by eslint-plugin-react-hooks being pulled in by both:

eslint-config-next
@wordpress/eslint-plugin

ESLint does not allow multiple versions of the same plugin in a single config, resulting in a plugin conflict error when running eslint.

Why

By adding the overrides field in the test app, we force a single version (^5.2.0) of eslint-plugin-react-hooks to be used throughout the dependency tree

Related Issue(s):

How

Added a package-level overrides entry in the test app's package.json:

"overrides": {
  "eslint-plugin-react-hooks": "^5.2.0"
}

Testing Instructions

  1. Run snapwp
  2. Scaffold the test app outside the snapwp directory, e.g. ../snapwp-app
  3. Run npm run lint in snapwp-app

Screenshots

Additional Info

Checklist

  • I have read the Contribution Guidelines.
  • My code is tested to the best of my abilities.
  • My code passes all lints (ESLint, tsc, prettier etc.).
  • My code has detailed inline documentation.
  • I have added unit tests to verify the code works as intended.
  • I have updated the project documentation as needed.
  • I have added a changeset for this PR using npm run changeset.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 18, 2025

🦋 Changeset detected

Latest commit: 91318fe

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Swanand01 Swanand01 requested a review from justlevine April 18, 2025 12:41
@justlevine justlevine changed the title Fix: override eslint-react-hooks-plugin fix: override eslint-react-hooks-plugin Apr 20, 2025
@justlevine justlevine merged commit 3671797 into develop Apr 21, 2025
22 checks passed
@justlevine justlevine deleted the fix/eslint-plugin-react-hooks-conflict branch April 21, 2025 06:59
justlevine added a commit that referenced this pull request Mar 12, 2026
* fix: override plugin version

* chore: add changeset

* Update orange-worms-shout.md

---------

Co-authored-by: Dovid Levine <david@axepress.dev>
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.

2 participants