GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — eslint-plugin-react-hooks: Add support for ESLint v9 by eps1lon · Pull Request #28773 · react/react

Conversation

@eps1lon

@eps1lon eps1lon commented Apr 6, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Based on #28774

Does not add support for flat configs i.e. does not adress #28313.

The PR only adds support for ESLint v9 with the old config format and sets up testing infra for separate ESLint versions. The only breaking changes that affected the plugin was around removal of context.getScope and context.getSource which have simple replacements in V9 so that we don't have to fork too much to be able to support ESLint V9 and earlier.

The last commit makes it so that we have no breaking changes. If we decide to drop support for ESLint < 9.x, we can just revert 80e7b49 (#28773)

Alternate to #28772

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

RoystonS, CHC383, lucasteles, callumlocke, SonNg1009, bryanprimus, stunaz, juliusmarminge, pauliesnug, artem-wt, and 26 more reacted with heart emoji
All reactions
  • ❤️ 36 reactions
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 6, 2024
@eps1lon
eps1lon force-pushed the rules-of-hooks-eslint-v9 branch from 80e7b49 to c5b335e Compare April 6, 2024 15:48
@eps1lon eps1lon mentioned this pull request Apr 6, 2024
eslint-plugin-react-hooks & "Flat Config" (ESLint 9) #28313
Closed
@react-sizebot

react-sizebot commented Apr 6, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Comparing: 699d03c...c1f1de3

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 497.71 kB 497.71 kB = 88.93 kB 88.93 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 504.00 kB 504.00 kB = 89.95 kB 89.95 kB
facebook-www/ReactDOM-prod.classic.js = 591.14 kB 591.14 kB = 103.91 kB 103.91 kB
facebook-www/ReactDOM-prod.modern.js = 566.95 kB 566.95 kB = 100.12 kB 100.12 kB
test_utils/ReactAllWarnings.js Deleted 64.80 kB 0.00 kB Deleted 16.14 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +1.19% 76.83 kB 77.75 kB +0.90% 14.07 kB 14.20 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +1.19% 76.83 kB 77.75 kB +0.90% 14.07 kB 14.20 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.production.js +1.16% 78.69 kB 79.60 kB +0.94% 14.31 kB 14.45 kB
oss-stable-semver/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +1.01% 93.66 kB 94.60 kB +0.61% 21.96 kB 22.09 kB
oss-stable/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +1.01% 93.66 kB 94.60 kB +0.61% 21.96 kB 22.09 kB
oss-experimental/eslint-plugin-react-hooks/cjs/eslint-plugin-react-hooks.development.js +1.00% 93.81 kB 94.75 kB +0.61% 21.98 kB 22.12 kB
test_utils/ReactAllWarnings.js Deleted 64.80 kB 0.00 kB Deleted 16.14 kB 0.00 kB

Generated by 🚫 dangerJS against c1f1de3

PPKk99 reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@eps1lon eps1lon mentioned this pull request Apr 6, 2024
feat(eslint-plugin-react-hooks): support ESLint v9 #28772
Closed
@eps1lon
eps1lon force-pushed the rules-of-hooks-eslint-v9 branch 2 times, most recently from 43a0927 to 1a217e9 Compare April 6, 2024 16:59
@eps1lon
eps1lon marked this pull request as ready for review April 7, 2024 07:50
Debbl
Debbl reviewed Apr 7, 2024
View reviewed changes
Comment thread packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
}
}

const scopeManager = context.getSourceCode().scopeManager;

@Debbl Debbl Apr 7, 2024

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context-methods-becoming-properties
I noticed that this context.getSourceCode() was replaced with context.sourceCode, you might want to confirm that.

const sourceCode = context.sourceCode ?? context.getSourceCode();
const scopeManager = sourceCode.scopeManager;

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@eps1lon eps1lon Apr 7, 2024

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSourceCode was only deprecated.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@PPKk99 PPKk99 May 18, 2025

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eps1lon Do you have the ability to collect what you neglected?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@suiyun39 suiyun39 mentioned this pull request Apr 9, 2024
支持 eslint 9.0.0 suiyun39/eslint-config-rakko#12
Closed
7 of 8 tasks
@zgeoff zgeoff mentioned this pull request Apr 10, 2024
reenable react eslint plugin rules when updated to support eslint 9 zgeoff/vers#7
Closed
@davidjbng davidjbng mentioned this pull request Apr 10, 2024
feat!(eslint-plugin-query): Migrate to ESLint v9 with Flat Config Support TanStack/query#7253
Closed
1 of 8 tasks
@rpearce rpearce mentioned this pull request Apr 12, 2024
chore(deps-dev): bump the eslint group with 4 updates rpearce/react-medium-image-zoom#520
Closed
@eps1lon
eps1lon force-pushed the rules-of-hooks-eslint-v9 branch from 88687c4 to e2da44f Compare April 12, 2024 08:02
@azangru azangru mentioned this pull request Apr 15, 2024
Update dependencies Ensembl/ensembl-client#1105
Merged
@haines haines mentioned this pull request Apr 15, 2024
Migrate to new ESLint flat configuration format cerbos/cerbos-sdk-javascript#922
Closed
5 tasks done
@DNR500 DNR500 mentioned this pull request Apr 15, 2024
spike: get eslint v9 working lifinance/widget#235
Closed
@KOBA789 KOBA789 mentioned this pull request Apr 19, 2024
Update dependency eslint to v9 - autoclosed arkedge/gaia#161
Closed
1 task
@eps1lon
eps1lon requested a review from poteto April 22, 2024 19:40
poteto
poteto approved these changes Apr 22, 2024
View reviewed changes
Comment thread yarn.lock

@poteto poteto Apr 22, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe split this out into a separate PR?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@eps1lon eps1lon Apr 22, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It kind of doesn't make sense for these change to stay if we revert ESlint v9 support. And if we need to revert the lockfile changes, we also need to revert ESLint v9 support.

Merge conflicts in yarn.lock are not an issue since you'd just run yarn. Yarn automatically resolves merge conflicts.

I rebased this PR to isolate these changes so if we do need to bisect later, we can still do it on this branch.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

poteto reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@poteto poteto Apr 22, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right, sorry I missed that there was a package.json update

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

eps1lon added 5 commits April 22, 2024 22:51
@eps1lon
Install ESLint v9
8590c49
Will be used to test compat between eslint-plugin-react-hooks and ESLint v9
@eps1lon
eslint-plugin-react-hooks: Add support for ESLint v9
8fdfca7
@eps1lon
Can't support earlier ESLint versions without forking
775bd6c
@eps1lon
No breaking changes
31ba7bf
@eps1lon
fork impl instead of checking an invariant every call
5d30424
@eps1lon
eps1lon force-pushed the rules-of-hooks-eslint-v9 branch from e2da44f to 5d30424 Compare April 22, 2024 20:53
@eps1lon @poteto
Update packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaust…
c1f1de3
…iveDeps-test.js

Co-authored-by: lauren <[email protected]>
@eps1lon eps1lon mentioned this pull request Apr 22, 2024
Install ESLint v9 #28892
Closed
@eps1lon
eps1lon merged commit 6f18664 into react:main Apr 23, 2024
This was referenced Feb 5, 2026
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#72
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#82
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#93
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#104
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#115
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#126
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#137
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#148
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#159
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#170
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#181
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#193
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#205
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#217
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#229
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#241
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#253
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#265
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#277
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#289
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#301
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#313
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#325
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#337
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#349
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#361
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#373
Closed
chore(deps): update dependency eslint-plugin-react-hooks to 7.0.1 stacksjs/raycast#385
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 3, 2026
chore: Bed 7852 bhce js security updates SpecterOps/BloodHound#2594
Merged
3 tasks done
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@eps1lon
eslint-plugin-react-hooks: Add support for ESLint v9 (react#28773)
38e342d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@poteto poteto poteto approved these changes
+2 more reviewers
@Debbl Debbl Debbl left review comments
@PPKk99 PPKk99 PPKk99 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

19 participants

@eps1lon @react-sizebot @silkfire @RomkeSandwave @yf-hk @thenbe @ArnaudBarre @lllapland @rburgst @xuhdev @c10b10 @EmilYanbaev @Foxeye-Rinx @RakaDoank @grubersjoe @CHC383 @poteto @Debbl @PPKk99
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.