Skip to content

Recognize use$ and use_ as hook names#36395

Open
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/compiler-hook-symbol-names
Open

Recognize use$ and use_ as hook names#36395
raashish1601 wants to merge 1 commit intofacebook:mainfrom
raashish1601:codex/compiler-hook-symbol-names

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

  • recognize use$ and use_ as hook names in compiler hook classification
  • keep existing behavior for names like use_hook that are intentionally not hook names
  • align the public rules-of-hooks heuristic and add compiler/ESLint regression coverage

Issue

Fixes #32473.

Validation

  • corepack yarn workspace snap run snap --pattern error.invalid-conditional-call-hook-symbol-names --sync
  • corepack yarn workspace eslint-plugin-react-hooks test ESLintRulesOfHooks-test.js --runInBand
  • corepack yarn workspace babel-plugin-react-compiler run lint -- --quiet
  • corepack yarn workspace eslint-plugin-react-hooks typecheck
  • corepack yarn prettier
  • corepack yarn prettier --write packages/eslint-plugin-react-hooks/src/rules/RulesOfHooks.ts packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js
  • git diff --cached --check

@meta-cla meta-cla Bot added the CLA Signed label May 2, 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.

[Compiler Bug]: Should support hooks named with symbols: use$, use_

1 participant