Skip to content

fix(linter/exhaustive-deps): handle destructuring inside hooks#11598

Merged
camc314 merged 3 commits intooxc-project:mainfrom
DonIsaac:don/linter/fix/exhaustive-deps-destructure
Jun 11, 2025
Merged

fix(linter/exhaustive-deps): handle destructuring inside hooks#11598
camc314 merged 3 commits intooxc-project:mainfrom
DonIsaac:don/linter/fix/exhaustive-deps-destructure

Conversation

@DonIsaac
Copy link
Copy Markdown
Contributor

What This PR Does

Updates react-hooks/exhaustive-deps to handle object/array destructuring within hooks.

Before, this rule would report props.foo as an unnecessary dependency

function MyComponent(props) {
  useEffect(() => {
    const { foo } = props;
    console.log(foo);
  }, [props.foo]);
}

@DonIsaac DonIsaac requested a review from camc314 as a code owner June 10, 2025 20:26
@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Jun 10, 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.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Jun 10, 2025
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Jun 10, 2025

CodSpeed Instrumentation Performance Report

Merging #11598 will not alter performance

Comparing DonIsaac:don/linter/fix/exhaustive-deps-destructure (94f0549) with main (b2bd741)

Summary

✅ 38 untouched benchmarks

@camc314 camc314 merged commit a6adc0c into oxc-project:main Jun 11, 2025
24 checks passed
@DonIsaac DonIsaac deleted the don/linter/fix/exhaustive-deps-destructure branch June 11, 2025 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants