@samitouri / QOS-React / commits / 0af4fd80ed

[test] Update ESLint e2e tests (#35233)

Sebastian "Sebbie" Silbermann committed Dec 1, 2025 at 19:03 UTC 0af4fd80ed0ceb85b472b079c94a96b8526fcd06
4 files changed +10 -8
fixtures/eslint-v6/index.js
+2 -2
@@ -159,9 +159,9 @@ function InvalidGlobals() {
159 return <div>Done</div>;
160 }
161
162 -// Invalid: useMemo with wrong deps - triggers preserve-manual-memoization
162 +// Invalid: useMemo with wrong deps
163 function InvalidUseMemo({items}) {
164 - // eslint-disable-next-line react-hooks/preserve-manual-memoization, react-hooks/exhaustive-deps
164 + // eslint-disable-next-line react-hooks/exhaustive-deps
165 const sorted = useMemo(() => [...items].sort(), []);
166 return <div>{sorted.length}</div>;
167 }
fixtures/eslint-v7/index.js
+2 -2
@@ -159,9 +159,9 @@ function InvalidGlobals() {
159 return <div>Done</div>;
160 }
161
162 -// Invalid: useMemo with wrong deps - triggers preserve-manual-memoization
162 +// Invalid: useMemo with wrong deps
163 function InvalidUseMemo({items}) {
164 - // eslint-disable-next-line react-hooks/preserve-manual-memoization, react-hooks/exhaustive-deps
164 + // eslint-disable-next-line react-hooks/exhaustive-deps
165 const sorted = useMemo(() => [...items].sort(), []);
166 return <div>{sorted.length}</div>;
167 }
fixtures/eslint-v8/index.js
+2 -2
@@ -159,9 +159,9 @@ function InvalidGlobals() {
159 return <div>Done</div>;
160 }
161
162 -// Invalid: useMemo with wrong deps - triggers preserve-manual-memoization
162 +// Invalid: useMemo with wrong deps
163 function InvalidUseMemo({items}) {
164 - // eslint-disable-next-line react-hooks/preserve-manual-memoization, react-hooks/exhaustive-deps
164 + // eslint-disable-next-line react-hooks/exhaustive-deps
165 const sorted = useMemo(() => [...items].sort(), []);
166 return <div>{sorted.length}</div>;
167 }
fixtures/eslint-v9/index.js
+4 -2
@@ -70,6 +70,7 @@ function ComponentWithoutDeclaringPropAsDep(props) {
70 console.log(props.foo);
71 // eslint-disable-next-line react-hooks/exhaustive-deps
72 }, []);
73 + // eslint-disable-next-line react-hooks/void-use-memo
74 useMemo(() => {
75 console.log(props.foo);
76 // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -82,6 +83,7 @@ function ComponentWithoutDeclaringPropAsDep(props) {
83 console.log(props.foo);
84 // eslint-disable-next-line react-hooks/exhaustive-deps
85 }, []);
86 + // eslint-disable-next-line react-hooks/void-use-memo
87 React.useMemo(() => {
88 console.log(props.foo);
89 // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -159,9 +161,9 @@ function InvalidGlobals() {
161 return <div>Done</div>;
162 }
163
162 -// Invalid: useMemo with wrong deps - triggers preserve-manual-memoization
164 +// Invalid: useMemo with wrong deps
165 function InvalidUseMemo({items}) {
164 - // eslint-disable-next-line react-hooks/preserve-manual-memoization, react-hooks/exhaustive-deps
166 + // eslint-disable-next-line react-hooks/exhaustive-deps
167 const sorted = useMemo(() => [...items].sort(), []);
168 return <div>{sorted.length}</div>;
169 }