Skip to content

Commit 3ceb237

Browse files
committed
exhaustive-deps: Add passing test for generic type arguments
1 parent 9c3de25 commit 3ceb237

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7722,6 +7722,16 @@ const testsTypescript = {
77227722
}
77237723
`,
77247724
},
7725+
{
7726+
code: normalizeIndent`
7727+
function useMyThing<T>(): void {
7728+
useEffect(() => {
7729+
let foo: T;
7730+
console.log(foo);
7731+
}, []);
7732+
}
7733+
`,
7734+
},
77257735
],
77267736
invalid: [
77277737
{

0 commit comments

Comments
 (0)