diff --git a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js index a98d2b76961f7..a1e4c49e15573 100644 --- a/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js +++ b/packages/eslint-plugin-react-hooks/__tests__/ESLintRulesOfHooks-test.js @@ -1129,6 +1129,34 @@ const tests = { `, errors: [asyncComponentHookError('useState')], }, + { + code: normalizeIndent` + async function Page() { + useId(); + React.useId(); + } + `, + errors: [ + asyncComponentHookError('useId'), + asyncComponentHookError('React.useId'), + ], + }, + { + code: normalizeIndent` + async function useAsyncHook() { + useId(); + } + `, + errors: [asyncComponentHookError('useId')], + }, + { + code: normalizeIndent` + async function notAHook() { + useId(); + } + `, + errors: [functionError('useId', 'notAHook')], + }, { code: normalizeIndent` Hook.use();