From ec8bf4bcccb5e3b751154c5a2f34a24277769be6 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 14 Mar 2024 15:41:37 +0100 Subject: [PATCH] Add passing exhaustive-deps test for type parameters in TypeScript (#20432) --- .../__tests__/ESLintRuleExhaustiveDeps-test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js b/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js index e10be9e5b5514..e2308906ae3ed 100644 --- a/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js +++ b/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js @@ -7774,6 +7774,16 @@ const testsTypescript = { } `, }, + { + code: normalizeIndent` + function useMyThing(): void { + useEffect(() => { + let foo: T; + console.log(foo); + }, []); + } + `, + }, ], invalid: [ {