File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
packages/eslint-plugin-react-hooks/__tests__ Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1129,6 +1129,34 @@ const tests = {
11291129 ` ,
11301130 errors : [ asyncComponentHookError ( 'useState' ) ] ,
11311131 } ,
1132+ {
1133+ code : normalizeIndent `
1134+ async function Page() {
1135+ useId();
1136+ React.useId();
1137+ }
1138+ ` ,
1139+ errors : [
1140+ asyncComponentHookError ( 'useId' ) ,
1141+ asyncComponentHookError ( 'React.useId' ) ,
1142+ ] ,
1143+ } ,
1144+ {
1145+ code : normalizeIndent `
1146+ async function useAsyncHook() {
1147+ useId();
1148+ }
1149+ ` ,
1150+ errors : [ asyncComponentHookError ( 'useId' ) ] ,
1151+ } ,
1152+ {
1153+ code : normalizeIndent `
1154+ async function notAHook() {
1155+ useId();
1156+ }
1157+ ` ,
1158+ errors : [ functionError ( 'useId' , 'notAHook' ) ] ,
1159+ } ,
11321160 {
11331161 code : normalizeIndent `
11341162 Hook.use();
You can’t perform that action at this time.
0 commit comments