From 56f69b8bdd29fa28ec67978c94b435a52e87f0a9 Mon Sep 17 00:00:00 2001 From: "Zihan Chen (MSFT)" <53799235+ZihanChen-MSFT@users.noreply.github.com> Date: Tue, 29 Nov 2022 14:04:54 -0800 Subject: [PATCH] Fix code review comments --- .../react-native-codegen/src/parsers/flow/modules/index.js | 4 +++- .../src/parsers/typescript/modules/index.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native-codegen/src/parsers/flow/modules/index.js b/packages/react-native-codegen/src/parsers/flow/modules/index.js index 36ffbbead3ad9b..2944905d1e7869 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/index.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/index.js @@ -179,6 +179,7 @@ function translateTypeAnnotation( ); if (indexers.length > 0) { // check the property type to prevent developers from using unsupported types + // the return value from `translateTypeAnnotation` is unused const propertyType = indexers[0].value; translateTypeAnnotation( hasteModuleName, @@ -265,8 +266,9 @@ function translateTypeAnnotation( case 'MixedTypeAnnotation': { if (cxxOnly) { return emitMixed(nullable); + } else { + return emitObject(nullable); } - // Fallthrough } default: { throw new UnsupportedTypeAnnotationParserError( diff --git a/packages/react-native-codegen/src/parsers/typescript/modules/index.js b/packages/react-native-codegen/src/parsers/typescript/modules/index.js index 71a904544d213c..25922bf4108210 100644 --- a/packages/react-native-codegen/src/parsers/typescript/modules/index.js +++ b/packages/react-native-codegen/src/parsers/typescript/modules/index.js @@ -198,6 +198,7 @@ function translateTypeAnnotation( ); if (indexSignatures.length > 0) { // check the property type to prevent developers from using unsupported types + // the return value from `translateTypeAnnotation` is unused const propertyType = indexSignatures[0].typeAnnotation; translateTypeAnnotation( hasteModuleName,