From b044ece59475c251bcf13bac0652f72d901e1c88 Mon Sep 17 00:00:00 2001 From: Marshall Roch Date: Thu, 2 Mar 2023 08:43:56 -0800 Subject: [PATCH] presuppress Flow v0.201 errors Summary: Changelog: [Internal] Reviewed By: SamChou19815 Differential Revision: D43720099 fbshipit-source-id: 6931548c90deb82cfc7e3d8173ccfc6aa7f0e1c8 --- Libraries/Utilities/codegenNativeCommands.js | 1 + packages/react-native-codegen/src/parsers/utils.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Libraries/Utilities/codegenNativeCommands.js b/Libraries/Utilities/codegenNativeCommands.js index ad0023d51d4fa1..3642b8c20aba17 100644 --- a/Libraries/Utilities/codegenNativeCommands.js +++ b/Libraries/Utilities/codegenNativeCommands.js @@ -18,6 +18,7 @@ function codegenNativeCommands(options: Options<$Keys>): T { const commandObj: {[$Keys]: (...$ReadOnlyArray) => void} = {}; options.supportedCommands.forEach(command => { + // $FlowFixMe[missing-local-annot] commandObj[command] = (ref, ...args) => { // $FlowFixMe[incompatible-call] dispatchCommand(ref, command, args); diff --git a/packages/react-native-codegen/src/parsers/utils.js b/packages/react-native-codegen/src/parsers/utils.js index 299bddef91d143..ca939b04af2774 100644 --- a/packages/react-native-codegen/src/parsers/utils.js +++ b/packages/react-native-codegen/src/parsers/utils.js @@ -38,6 +38,7 @@ function createParserErrorCapturer(): [ Array, ParserErrorCapturer, ] { + // $FlowFixMe[missing-empty-array-annot] const errors = []; function guard(fn: () => T): ?T { try { @@ -46,12 +47,14 @@ function createParserErrorCapturer(): [ if (!(error instanceof ParserError)) { throw error; } + // $FlowFixMe[incompatible-call] errors.push(error); return null; } } + // $FlowFixMe[incompatible-return] return [errors, guard]; }