Skip to content

feat(linter/exhaustive-deps): add support for useEffectEvent#14041

Merged
camc314 merged 2 commits intooxc-project:mainfrom
stipsan:patch-1
Sep 24, 2025
Merged

feat(linter/exhaustive-deps): add support for useEffectEvent#14041
camc314 merged 2 commits intooxc-project:mainfrom
stipsan:patch-1

Conversation

@stipsan
Copy link
Contributor

@stipsan stipsan commented Sep 23, 2025

In order to support: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event
We use https://www.npmjs.com/package/use-effect-event in a lot of places, and this is the last blocker for us to use oxlint

Copilot AI review requested due to automatic review settings September 23, 2025 11:14
@stipsan stipsan requested a review from camc314 as a code owner September 23, 2025 11:14
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 23, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for React's useEffectEvent hook in the exhaustive dependencies rule by treating it as a stable value that doesn't need to be included in dependency arrays.

  • Modified the is_stable_value function to recognize useEffectEvent as stable
  • Added test cases demonstrating correct behavior with useEffectEvent

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot added the A-linter Area - Linter label Sep 23, 2025
@stipsan stipsan changed the title Add support for useEffectEvent in exhaustive deps rule feat: support for useEffectEvent in exhaustive deps rule Sep 23, 2025
@camc314
Copy link
Contributor

camc314 commented Sep 23, 2025

https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event

How are you using this currently with eslint, useEffectEvent is marked as experimental, and is complied out in the eslint plugin. build

@stipsan
Copy link
Contributor Author

stipsan commented Sep 23, 2025

https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event

How are you using this currently with eslint, useEffectEvent is marked as experimental, and is complied out in the eslint plugin.

it requires using eslint-plugin-react-hooks@experimental atm: https://react.dev/reference/react/experimental_useEffectEvent#noun-labs-1201738-(2)

@camc314 camc314 changed the title feat: support for useEffectEvent in exhaustive deps rule feat(linter): support for useEffectEvent in exhaustive deps rule Sep 24, 2025
@github-actions github-actions bot added the C-enhancement Category - New feature or request label Sep 24, 2025
@camc314 camc314 changed the title feat(linter): support for useEffectEvent in exhaustive deps rule feat(linter/exhaustive-deps): support for useEffectEvent in exhaustive deps rule Sep 24, 2025
@camc314 camc314 changed the title feat(linter/exhaustive-deps): support for useEffectEvent in exhaustive deps rule feat(linter/exhaustive-deps): add support for `useEffectEvent Sep 24, 2025
@camc314 camc314 changed the title feat(linter/exhaustive-deps): add support for `useEffectEvent feat(linter/exhaustive-deps): add support for useEffectEvent Sep 24, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Sep 24, 2025

CodSpeed Instrumentation Performance Report

Merging #14041 will not alter performance

Comparing stipsan:patch-1 (9cbf964) with main (1521a1f)1

Summary

✅ 37 untouched

Footnotes

  1. No successful run was found on main (3a706a7) during the generation of this report, so 1521a1f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@camc314 camc314 self-assigned this Sep 24, 2025
stipsan and others added 2 commits September 24, 2025 09:55
Signed-off-by: Cody Olsen <81981+stipsan@users.noreply.github.com>
@camc314 camc314 merged commit 2481964 into oxc-project:main Sep 24, 2025
25 checks passed
@stipsan stipsan deleted the patch-1 branch September 25, 2025 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants