From 7caf071e01afcc6a3ccb9c3f3a5c41fbcb3d6152 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Mon, 6 May 2024 20:39:49 -0400 Subject: [PATCH] Add failing test for eslint-plugin false positive The eslint rule seems to false positive on this typescript syntax, but strangely the compiler does not ghstack-source-id: 19baa24ff7addd83f59e2b03fdb180af169a2794 Pull Request resolved: https://github.com/facebook/react-forget/pull/2913 --- .../ReactCompilerRuleTypescript-test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/compiler/packages/eslint-plugin-react-compiler/__tests__/ReactCompilerRuleTypescript-test.ts b/compiler/packages/eslint-plugin-react-compiler/__tests__/ReactCompilerRuleTypescript-test.ts index c4bbac351a..3ac2bec2da 100644 --- a/compiler/packages/eslint-plugin-react-compiler/__tests__/ReactCompilerRuleTypescript-test.ts +++ b/compiler/packages/eslint-plugin-react-compiler/__tests__/ReactCompilerRuleTypescript-test.ts @@ -36,6 +36,22 @@ const tests: CompilerTestCases = { }, ], invalid: [ + { + name: "[FALSE POSITIVE] Repro for hooks as normal values", + filename: "test.tsx", + code: normalizeIndent` + function Button(props) { + const scrollview = React.useRef(null); + return