Skip to content

Ignore nested typeof references in exhaustive-deps#36412

Open
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/exhaustive-deps-ignore-nested-typeof
Open

Ignore nested typeof references in exhaustive-deps#36412
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/exhaustive-deps-ignore-nested-typeof

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

Fixes #27335.

Nested references inside TypeScript typeof queries are type-only and should not be reported as Hook dependencies. The rule already ignored direct TSTypeQuery parents; this walks from the original reference node so nested paths like typeof foo.bar are also skipped.

Tests

  • corepack yarn --cwd packages/eslint-plugin-react-hooks jest ESLintRuleExhaustiveDeps-test --runInBand
  • corepack yarn --cwd packages/eslint-plugin-react-hooks typecheck
  • git diff --check

@meta-cla meta-cla Bot added the CLA Signed label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: eslint-plugin-react-hooks: Incorrect dependency requirement when using typeof on nested data structures

1 participant