diff --git a/.flowconfig b/.flowconfig index 1e826602688..e2b44bdad1b 100644 --- a/.flowconfig +++ b/.flowconfig @@ -75,6 +75,7 @@ module.system.haste.module_ref_prefix=m# react.runtime=automatic +experimental.error_code_migration=new suppress_type=$FlowFixMe ban_spread_key_props=true diff --git a/flow-typed/npm/ws_v7.x.x.js b/flow-typed/npm/ws_v7.x.x.js index d549f377039..151be0d2699 100644 --- a/flow-typed/npm/ws_v7.x.x.js +++ b/flow-typed/npm/ws_v7.x.x.js @@ -21,7 +21,7 @@ declare type ws$PerMessageDeflateOptions = { maxPayload?: number, }; -/* $FlowFixMe[incompatible-extend] - Found with Flow v0.143.1 upgrade +/* $FlowFixMe[incompatible-type] - Found with Flow v0.143.1 upgrade * "on" definition failing with string is incompatible with string literal */ declare class ws$WebSocketServer extends events$EventEmitter { /** @@ -141,7 +141,7 @@ declare type ws$UnexpectedResponseListener = ( ) => mixed; declare type ws$UpgradeListener = (response: http$IncomingMessage<>) => mixed; -/* $FlowFixMe[incompatible-extend] - Found with Flow v0.143.1 upgrade +/* $FlowFixMe[incompatible-type] - Found with Flow v0.143.1 upgrade * "on" definition failing with string is incompatible with string literal */ declare class ws$WebSocket extends events$EventEmitter { static Server: typeof ws$WebSocketServer; diff --git a/jest/preprocessor.js b/jest/preprocessor.js index dc03ccb3ed0..90d6c464647 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -86,7 +86,7 @@ module.exports = { globalPrefix: '', hermesParser: true, hot: false, - // $FlowFixMe[incompatible-call] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS + // $FlowFixMe[incompatible-type] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS inlineRequires: true, minify: false, platform: '', @@ -111,7 +111,7 @@ module.exports = { return generate( ast, - // $FlowFixMe[prop-missing] Error found when improving flow typing for libs + // $FlowFixMe[incompatible-type] Error found when improving flow typing for libs { code: true, comments: false, diff --git a/packages/community-cli-plugin/src/commands/bundle/saveAssets.js b/packages/community-cli-plugin/src/commands/bundle/saveAssets.js index 454380748ed..2a759a0540f 100644 --- a/packages/community-cli-plugin/src/commands/bundle/saveAssets.js +++ b/packages/community-cli-plugin/src/commands/bundle/saveAssets.js @@ -116,7 +116,7 @@ function copyAll(filesToCopy: CopiedFiles) { const src = queue.shift(); // $FlowFixMe[incompatible-type] const dest = filesToCopy[src]; - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] copy(src, dest, copyNext); } }; diff --git a/packages/dev-middleware/src/__tests__/InspectorDebuggerUtils.js b/packages/dev-middleware/src/__tests__/InspectorDebuggerUtils.js index 7ccd45b2629..172d0270a79 100644 --- a/packages/dev-middleware/src/__tests__/InspectorDebuggerUtils.js +++ b/packages/dev-middleware/src/__tests__/InspectorDebuggerUtils.js @@ -105,8 +105,9 @@ export class DebuggerMock extends DebuggerAgent { : this.handle.mock.calls; // $FlowFixMe[incompatible-use] // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] const [response] = newHandleCalls.find(args => args[0].id === message.id); - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] // $FlowFixMe[incompatible-indexer] return response; } diff --git a/packages/dev-middleware/src/__tests__/InspectorDeviceUtils.js b/packages/dev-middleware/src/__tests__/InspectorDeviceUtils.js index 12e913d3142..1c8c1a55be4 100644 --- a/packages/dev-middleware/src/__tests__/InspectorDeviceUtils.js +++ b/packages/dev-middleware/src/__tests__/InspectorDeviceUtils.js @@ -152,12 +152,12 @@ export class DeviceMock extends DeviceAgent { if (!payload) { return; } - // $FlowFixMe[incompatible-call] TODO(moti) Figure out the right way to type maybePayload generically + // $FlowFixMe[incompatible-type] TODO(moti) Figure out the right way to type maybePayload generically this.send({event, payload}); }); return; } - // $FlowFixMe[incompatible-call] TODO(moti) Figure out the right way to type maybePayload generically + // $FlowFixMe[incompatible-type] TODO(moti) Figure out the right way to type maybePayload generically this.send({event, payload: maybePayload}); } } diff --git a/packages/dev-middleware/src/__tests__/InspectorProtocolUtils.js b/packages/dev-middleware/src/__tests__/InspectorProtocolUtils.js index 35f7a025e2c..4b5c6844531 100644 --- a/packages/dev-middleware/src/__tests__/InspectorProtocolUtils.js +++ b/packages/dev-middleware/src/__tests__/InspectorProtocolUtils.js @@ -66,7 +66,7 @@ export async function sendFromTargetToDebugger( : debugger_.handle.mock.calls; // $FlowFixMe[incompatible-type] const [receivedMessage]: [Message] = newHandleCalls.find( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] (call: [Message]) => call[0].method === message.method, ); return receivedMessage; @@ -103,7 +103,7 @@ export async function sendFromDebuggerToTarget( // $FlowFixMe[incompatible-use] call => call[0].wrappedEvent.id === message.id, ); - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return receivedMessage.wrappedEvent; } diff --git a/packages/dev-middleware/src/__tests__/ServerUtils.js b/packages/dev-middleware/src/__tests__/ServerUtils.js index acb0bf90a81..71de93c4875 100644 --- a/packages/dev-middleware/src/__tests__/ServerUtils.js +++ b/packages/dev-middleware/src/__tests__/ServerUtils.js @@ -93,7 +93,7 @@ export async function createServer(options: CreateServerOptions): Promise<{ ); httpServer = https.createServer( {cert, key}, - // $FlowFixMe[incompatible-call] The types for `connect` and `https` are subtly incompatible as written. + // $FlowFixMe[incompatible-type] The types for `connect` and `https` are subtly incompatible as written. app, ); } else { diff --git a/packages/dev-middleware/src/__tests__/getBaseUrlFromRequest-test.js b/packages/dev-middleware/src/__tests__/getBaseUrlFromRequest-test.js index 154566b57b6..6be915bc51e 100644 --- a/packages/dev-middleware/src/__tests__/getBaseUrlFromRequest-test.js +++ b/packages/dev-middleware/src/__tests__/getBaseUrlFromRequest-test.js @@ -40,7 +40,7 @@ function makeRequest( host: ?string, encrypted: boolean, ): http$IncomingMessage<> | http$IncomingMessage { - // $FlowFixMe[incompatible-return] Partial mock of request + // $FlowFixMe[incompatible-type] Partial mock of request return { socket: encrypted ? {encrypted: true} : {}, headers: host != null ? {host} : {}, diff --git a/packages/dev-middleware/src/createDevMiddleware.js b/packages/dev-middleware/src/createDevMiddleware.js index 2757fe31d61..67928d7bb06 100644 --- a/packages/dev-middleware/src/createDevMiddleware.js +++ b/packages/dev-middleware/src/createDevMiddleware.js @@ -81,7 +81,7 @@ export default function createDevMiddleware({ projectRoot, serverBaseUrl, logger, - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] unstable_browserLauncher = DefaultBrowserLauncher, unstable_eventReporter, unstable_experiments: experimentConfig = {}, diff --git a/packages/dev-middleware/src/inspector-proxy/Device.js b/packages/dev-middleware/src/inspector-proxy/Device.js index f23e1cea4fd..2fa4695caeb 100644 --- a/packages/dev-middleware/src/inspector-proxy/Device.js +++ b/packages/dev-middleware/src/inspector-proxy/Device.js @@ -179,7 +179,7 @@ export default class Device { this.#deviceEventReporter?.logProfilingTargetRegistered(); } - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] this.#deviceSocket.on('message', (message: string) => { try { const parsedMessage = JSON.parse(message); @@ -408,7 +408,7 @@ export default class Device { this.#sendConnectEventToDevice(this.#mapToDevicePageId(pageId)); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] socket.on('message', (message: string) => { this.#cdpDebugLogging.log('DebuggerToProxy', message); const debuggerRequest = JSON.parse(message); diff --git a/packages/polyfills/__tests__/consoleTimeStamp-itest.js b/packages/polyfills/__tests__/consoleTimeStamp-itest.js index f7ada6406f6..5610348a89d 100644 --- a/packages/polyfills/__tests__/consoleTimeStamp-itest.js +++ b/packages/polyfills/__tests__/consoleTimeStamp-itest.js @@ -31,10 +31,10 @@ describe('console.timeStamp()', () => { }); it("doesn't throw when invalid arguments are specified", () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => console.timeStamp({})).not.toThrow(); expect(() => - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] console.timeStamp('label', true, null, {}, [], () => {}), ).not.toThrow(); }); diff --git a/packages/polyfills/error-guard.js b/packages/polyfills/error-guard.js index 0ae47c6bd3f..b00d760e216 100644 --- a/packages/polyfills/error-guard.js +++ b/packages/polyfills/error-guard.js @@ -63,7 +63,7 @@ const ErrorUtils = { ): ?TOut { try { _inGuard++; - /* $FlowFixMe[incompatible-call] : TODO T48204745 (1) apply(context, + /* $FlowFixMe[incompatible-type] : TODO T48204745 (1) apply(context, * null) is fine. (2) array -> rest array should work */ /* $FlowFixMe[incompatible-type] : TODO T48204745 (1) apply(context, * null) is fine. (2) array -> rest array should work */ @@ -81,7 +81,7 @@ const ErrorUtils = { args?: ?TArgs, ): ?TOut { if (ErrorUtils.inGuard()) { - /* $FlowFixMe[incompatible-call] : TODO T48204745 (1) apply(context, + /* $FlowFixMe[incompatible-type] : TODO T48204745 (1) apply(context, * null) is fine. (2) array -> rest array should work */ /* $FlowFixMe[incompatible-type] : TODO T48204745 (1) apply(context, * null) is fine. (2) array -> rest array should work */ diff --git a/packages/react-native-babel-transformer/src/__tests__/transform-test.js b/packages/react-native-babel-transformer/src/__tests__/transform-test.js index 58e41a6859c..bdf4e79c7c5 100644 --- a/packages/react-native-babel-transformer/src/__tests__/transform-test.js +++ b/packages/react-native-babel-transformer/src/__tests__/transform-test.js @@ -41,7 +41,7 @@ it('exposes the correct absolute path to a source file to plugins', () => { enableBabelRCLookup: false, globalPrefix: '__metro__', hot: false, - // $FlowFixMe[incompatible-call] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS + // $FlowFixMe[incompatible-type] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS inlineRequires: true, minify: false, platform: null, diff --git a/packages/react-native-codegen/src/generators/components/ComponentsGeneratorUtils.js b/packages/react-native-codegen/src/generators/components/ComponentsGeneratorUtils.js index 81a71ce21ea..68ecdca3bd0 100644 --- a/packages/react-native-codegen/src/generators/components/ComponentsGeneratorUtils.js +++ b/packages/react-native-codegen/src/generators/components/ComponentsGeneratorUtils.js @@ -280,9 +280,9 @@ function getLocalImports( ) { imports.add('#include '); const objectProps = typeAnnotation.elementType.properties; - // $FlowFixMe[incompatible-call] the type is guaranteed to be ObjectTypeAnnotation + // $FlowFixMe[incompatible-type] the type is guaranteed to be ObjectTypeAnnotation const objectImports = getImports(objectProps); - // $FlowFixMe[incompatible-call] the type is guaranteed to be ObjectTypeAnnotation + // $FlowFixMe[incompatible-type] the type is guaranteed to be ObjectTypeAnnotation const localImports = getLocalImports(objectProps); // $FlowFixMe[method-unbinding] added when improving typing for this parameters objectImports.forEach(imports.add, imports); diff --git a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js index 6edfbf40622..c9669a0c311 100644 --- a/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js +++ b/packages/react-native-codegen/src/generators/components/GeneratePropsJavaPojo/PojoCollector.js @@ -145,7 +145,7 @@ class PojoCollector { } })(); - /* $FlowFixMe[incompatible-return] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ return { type: 'ArrayTypeAnnotation', diff --git a/packages/react-native-codegen/src/generators/components/JavaHelpers.js b/packages/react-native-codegen/src/generators/components/JavaHelpers.js index 90166b9a24d..40f7bf9a904 100644 --- a/packages/react-native-codegen/src/generators/components/JavaHelpers.js +++ b/packages/react-native-codegen/src/generators/components/JavaHelpers.js @@ -108,7 +108,7 @@ function getImports( const typeAnnotation = prop.typeAnnotation; if (typeAnnotation.type === 'ReservedPropTypeAnnotation') { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] addImportsForNativeName(typeAnnotation.name); } diff --git a/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js b/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js index 9596442b09d..013cfce5b9a 100644 --- a/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js +++ b/packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js @@ -95,7 +95,7 @@ describe('wrapNullable', () => { describe('unwrapNullable', () => { describe('when type annotation is nullable', () => { it('returns original type annotation', () => { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] const result = unwrapNullable<{ type: 'NullableTypeAnnotation', typeAnnotation: {type: 'BooleanTypeAnnotation'}, @@ -422,7 +422,7 @@ describe('buildSchemaFromConfigType', () => { astMock, wrapComponentSchemaMock, buildComponentSchemaMock, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ buildModuleSchemaMock, parser, @@ -487,7 +487,7 @@ describe('buildSchemaFromConfigType', () => { describe('when buildModuleSchema returns null', () => { it('throws an error', () => { - // $FlowFixMe[incompatible-call] - This is to test an invariant + // $FlowFixMe[incompatible-type] - This is to test an invariant buildModuleSchemaMock.mockReturnValueOnce(null); expect(() => diff --git a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js index 1860af2c995..b73cd8aa02a 100644 --- a/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js +++ b/packages/react-native-codegen/src/parsers/__tests__/parsers-primitives-test.js @@ -379,10 +379,10 @@ describe('typeAliasResolution', () => { it('returns nullable TypeAliasTypeAnnotation and map it in aliasMap', () => { const aliasMap = {}; const result = typeAliasResolution( - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ typeResolution, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ objectTypeAnnotation, aliasMap, @@ -404,10 +404,10 @@ describe('typeAliasResolution', () => { it('returns non nullable TypeAliasTypeAnnotation and map it in aliasMap', () => { const aliasMap = {}; const result = typeAliasResolution( - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ typeResolution, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ objectTypeAnnotation, aliasMap, @@ -430,10 +430,10 @@ describe('typeAliasResolution', () => { it('returns nullable ObjectTypeAnnotation', () => { const aliasMap = {}; const result = typeAliasResolution( - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ typeResolution, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ objectTypeAnnotation, aliasMap, @@ -452,10 +452,10 @@ describe('typeAliasResolution', () => { it('returns non nullable ObjectTypeAnnotation', () => { const aliasMap = {}; const result = typeAliasResolution( - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ typeResolution, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ objectTypeAnnotation, aliasMap, @@ -1246,7 +1246,7 @@ describe('emitUnion', () => { const expected = new UnsupportedUnionTypeAnnotationParserError( hasteModuleName, typeAnnotation, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ unionTypes, ); @@ -1262,7 +1262,7 @@ describe('emitUnion', () => { const expected = new UnsupportedUnionTypeAnnotationParserError( hasteModuleName, typeAnnotation, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ unionTypes, ); 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 40d63cd3afc..51972f39ae0 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/index.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/index.js @@ -222,7 +222,7 @@ function translateTypeAnnotation( return typeAliasResolution( typeResolutionStatus, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ objectTypeAnnotation, aliasMap, diff --git a/packages/react-native-codegen/src/parsers/parserMock.js b/packages/react-native-codegen/src/parsers/parserMock.js index a906a348e9d..7b22d8a0a5e 100644 --- a/packages/react-native-codegen/src/parsers/parserMock.js +++ b/packages/react-native-codegen/src/parsers/parserMock.js @@ -116,19 +116,19 @@ export class MockedParser implements Parser { } parseFile(filename: string): SchemaType { - /* $FlowFixMe[incompatible-return] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ return schemaMock; } parseString(contents: string, filename: ?string): SchemaType { - /* $FlowFixMe[incompatible-return] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ return schemaMock; } parseModuleFixture(filename: string): SchemaType { - /* $FlowFixMe[incompatible-return] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ return schemaMock; } diff --git a/packages/react-native-codegen/src/parsers/parsers-primitives.js b/packages/react-native-codegen/src/parsers/parsers-primitives.js index 6fa749cea97..27097a0b0b6 100644 --- a/packages/react-native-codegen/src/parsers/parsers-primitives.js +++ b/packages/react-native-codegen/src/parsers/parsers-primitives.js @@ -526,7 +526,7 @@ function translateArrayTypeAnnotation( return wrapNullable(nullable, { type: 'ArrayTypeAnnotation', - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] elementType: wrapNullable(isElementTypeNullable, _elementType), }); } catch (ex) { 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 16b407bf03a..15f96966660 100644 --- a/packages/react-native-codegen/src/parsers/typescript/modules/index.js +++ b/packages/react-native-codegen/src/parsers/typescript/modules/index.js @@ -103,7 +103,7 @@ function translateObjectTypeAnnotation( return typeAliasResolution( typeResolutionStatus, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ objectTypeAnnotation, aliasMap, diff --git a/packages/react-native-codegen/src/parsers/typescript/parser.js b/packages/react-native-codegen/src/parsers/typescript/parser.js index 82ac353a5f1..edbaf368b52 100644 --- a/packages/react-native-codegen/src/parsers/typescript/parser.js +++ b/packages/react-native-codegen/src/parsers/typescript/parser.js @@ -108,8 +108,8 @@ class TypeScriptParser implements Parser { } remapUnionTypeAnnotationMemberNames( - membersTypes: $FlowFixMe[], - ): UnionTypeAnnotationMemberType[] { + membersTypes: Array<$FlowFixMe>, + ): Array { const remapLiteral = (item: $FlowFixMe) => { return item.literal ? item.literal.type @@ -118,14 +118,14 @@ class TypeScriptParser implements Parser { : 'ObjectTypeAnnotation'; }; - /* $FlowFixMe[incompatible-return] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ return [...new Set(membersTypes.map(remapLiteral))]; } getStringLiteralUnionTypeAnnotationStringLiterals( - membersTypes: $FlowFixMe[], - ): string[] { + membersTypes: Array<$FlowFixMe>, + ): Array { return membersTypes.map((item: $FlowFixMe) => item.literal.value); } diff --git a/packages/react-native-codegen/src/parsers/utils.js b/packages/react-native-codegen/src/parsers/utils.js index 2c6ab4996f6..c96b7eee825 100644 --- a/packages/react-native-codegen/src/parsers/utils.js +++ b/packages/react-native-codegen/src/parsers/utils.js @@ -52,14 +52,14 @@ function createParserErrorCapturer(): [ if (!(error instanceof ParserError)) { throw error; } - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] errors.push(error); return null; } } - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return [errors, guard]; } diff --git a/packages/react-native-compatibility-check/src/TypeDiffing.js b/packages/react-native-compatibility-check/src/TypeDiffing.js index afe5def0a6b..49a0202e07a 100644 --- a/packages/react-native-compatibility-check/src/TypeDiffing.js +++ b/packages/react-native-compatibility-check/src/TypeDiffing.js @@ -555,9 +555,9 @@ export function compareObjectTypes( return makeError( typeAnnotationComparisonError( 'Object types do not match.', - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] objectTypeAnnotation(newerPropertyTypes), - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] objectTypeAnnotation(olderPropertyTypes), ), ); diff --git a/packages/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js b/packages/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js index e556ef5158c..3ed03402646 100644 --- a/packages/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/packages/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -121,11 +121,11 @@ const ActionSheetIOS = { RCTActionSheetManager.showActionSheetWithOptions( { ...remainingOptions, - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] tintColor: processedTintColor, - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] cancelButtonTintColor: processedCancelButtonTintColor, - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] disabledButtonTintColor: processedDisabledButtonTintColor, destructiveButtonIndices, }, diff --git a/packages/react-native/Libraries/Alert/RCTAlertManager.android.js b/packages/react-native/Libraries/Alert/RCTAlertManager.android.js index d09946be5a2..7b482808a3a 100644 --- a/packages/react-native/Libraries/Alert/RCTAlertManager.android.js +++ b/packages/react-native/Libraries/Alert/RCTAlertManager.android.js @@ -24,10 +24,10 @@ export function alertWithArgs( } NativeDialogManagerAndroid.showAlert( - // $FlowFixMe[prop-missing] - Mismatched platform interfaces. + // $FlowFixMe[incompatible-type] - Mismatched platform interfaces. args, emptyCallback, - // $FlowFixMe[incompatible-call] - Mismatched platform interfaces. + // $FlowFixMe[incompatible-type] - Mismatched platform interfaces. /* $FlowFixMe[constant-condition] Error discovered during Constant * Condition roll out. See https://fburl.com/workplace/1v97vimq. */ callback || emptyCallback, diff --git a/packages/react-native/Libraries/Animated/AnimatedEvent.js b/packages/react-native/Libraries/Animated/AnimatedEvent.js index ba84a2eaf7e..cb5ae81269e 100644 --- a/packages/react-native/Libraries/Animated/AnimatedEvent.js +++ b/packages/react-native/Libraries/Animated/AnimatedEvent.js @@ -84,7 +84,7 @@ export function attachNativeEventImpl( NativeAnimatedHelper.API.removeAnimatedEventFromView( viewTag, eventName, - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] mapping.animatedValueTag, ); }); diff --git a/packages/react-native/Libraries/Animated/AnimatedImplementation.js b/packages/react-native/Libraries/Animated/AnimatedImplementation.js index 3d2a58eb659..610e68ef8bb 100644 --- a/packages/react-native/Libraries/Animated/AnimatedImplementation.js +++ b/packages/react-native/Libraries/Animated/AnimatedImplementation.js @@ -462,7 +462,7 @@ type LoopAnimationConfig = { const loopImpl = function ( animation: CompositeAnimation, - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] {iterations = -1, resetBeforeIteration = true}: LoopAnimationConfig = {}, ): CompositeAnimation { let isFinished = false; diff --git a/packages/react-native/Libraries/Animated/AnimatedMock.js b/packages/react-native/Libraries/Animated/AnimatedMock.js index 87338979f96..88eab881538 100644 --- a/packages/react-native/Libraries/Animated/AnimatedMock.js +++ b/packages/react-native/Libraries/Animated/AnimatedMock.js @@ -158,7 +158,7 @@ type LoopAnimationConfig = { const loop = function ( animation: CompositeAnimation, - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] {iterations = -1}: LoopAnimationConfig = {}, ): CompositeAnimation { return emptyAnimation; diff --git a/packages/react-native/Libraries/Animated/__tests__/Animated-test.js b/packages/react-native/Libraries/Animated/__tests__/Animated-test.js index beb847e5954..9a85755974e 100644 --- a/packages/react-native/Libraries/Animated/__tests__/Animated-test.js +++ b/packages/react-native/Libraries/Animated/__tests__/Animated-test.js @@ -251,7 +251,7 @@ describe('Animated', () => { it('warns if `useNativeDriver` is missing', () => { jest.spyOn(console, 'warn').mockImplementationOnce(() => {}); - // $FlowExpectedError[prop-missing] + // $FlowExpectedError[incompatible-type] Animated.spring(new Animated.Value(0), { toValue: 0, velocity: 0, @@ -665,7 +665,7 @@ describe('Animated', () => { const anim2 = {start: jest.fn(), stop: jest.fn()}; const seq = Animated.sequence([anim1 as $FlowFixMe, anim2 as $FlowFixMe]); - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] const loop = Animated.loop(seq, {resetBeforeIteration: false}); loop.start(); @@ -1191,7 +1191,7 @@ describe('Animated', () => { color = new Animated.Color('unknown'); expect(color.__getValue()).toEqual('rgba(0, 0, 0, 1)'); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] color = new Animated.Color({key: 'value'}); expect(color.__getValue()).toEqual('rgba(0, 0, 0, 1)'); }); diff --git a/packages/react-native/Libraries/Animated/__tests__/Interpolation-test.js b/packages/react-native/Libraries/Animated/__tests__/Interpolation-test.js index 45552748e1d..a1000ac6066 100644 --- a/packages/react-native/Libraries/Animated/__tests__/Interpolation-test.js +++ b/packages/react-native/Libraries/Animated/__tests__/Interpolation-test.js @@ -18,7 +18,7 @@ function createInterpolation( ): number => T { let parentValue = null; const interpolation = new AnimatedInterpolation( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] {__getValue: () => parentValue}, config, ); @@ -68,7 +68,7 @@ describe('Interpolation', () => { it('should throw for non monotonic input ranges', () => { expect( () => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] new AnimatedInterpolation(null, { inputRange: [0, 2, 1], outputRange: [0, 1, 2], @@ -77,7 +77,7 @@ describe('Interpolation', () => { expect( () => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] new AnimatedInterpolation(null, { inputRange: [0, 1, 2], outputRange: [0, 3, 1], @@ -189,7 +189,7 @@ describe('Interpolation', () => { it('should throw for an infinite input range', () => { expect( () => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] new AnimatedInterpolation(null, { inputRange: [-Infinity, Infinity], outputRange: [0, 1], @@ -198,7 +198,7 @@ describe('Interpolation', () => { expect( () => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] new AnimatedInterpolation(null, { inputRange: [-Infinity, 0, Infinity], outputRange: [1, 2, 3], @@ -304,7 +304,7 @@ describe('Interpolation', () => { outputRange: [0, 1], }); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] interpolation('45rad'); }).toThrow(); }); @@ -369,7 +369,7 @@ describe('Interpolation', () => { 'should convert %s to numbers in the native config', (_, outputRange, expected) => { const config = new AnimatedInterpolation( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] {}, {inputRange: [0, 1], outputRange}, ).__getNativeConfig(); diff --git a/packages/react-native/Libraries/Animated/__tests__/NativeAnimatedAllowlist-test.js b/packages/react-native/Libraries/Animated/__tests__/NativeAnimatedAllowlist-test.js index ae8c14eda2f..c5e56093eaf 100644 --- a/packages/react-native/Libraries/Animated/__tests__/NativeAnimatedAllowlist-test.js +++ b/packages/react-native/Libraries/Animated/__tests__/NativeAnimatedAllowlist-test.js @@ -17,17 +17,17 @@ describe('NativeAnimatedAllowlist', () => { it('checks invalid style props', () => { const {isSupportedStyleProp} = require('../NativeAnimatedAllowlist'); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(isSupportedStyleProp(null)).toBe(false); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(isSupportedStyleProp(undefined)).toBe(false); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(isSupportedStyleProp({})).toBe(false); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(isSupportedStyleProp([])).toBe(false); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(isSupportedStyleProp(true)).toBe(false); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(isSupportedStyleProp(false)).toBe(false); }); diff --git a/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js b/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js index 7aa92833b67..90d5356f0b9 100644 --- a/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js +++ b/packages/react-native/Libraries/Animated/components/AnimatedScrollView.js @@ -89,7 +89,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = const {intermediatePropsForRefreshControl, intermediatePropsForScrollView} = useMemo(() => { // $FlowFixMe[underconstrained-implicit-instantiation] - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] const {outer, inner} = splitLayoutProps(flattenStyle(props.style)); return { intermediatePropsForRefreshControl: {style: outer}, diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedColor.js b/packages/react-native/Libraries/Animated/nodes/AnimatedColor.js index d22eb610cb0..5a611cf85af 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedColor.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedColor.js @@ -60,12 +60,12 @@ function processColor( } if (isRgbaValue(color)) { - // $FlowFixMe[incompatible-cast] - Type is verified above + // $FlowFixMe[incompatible-type] - Type is verified above return (color: RgbaValue); } let normalizedColor: ?ProcessedColorValue = normalizeColor( - // $FlowFixMe[incompatible-cast] - Type is verified above + // $FlowFixMe[incompatible-type] - Type is verified above (color: ColorValue), ); if (normalizedColor === undefined || normalizedColor === null) { @@ -125,7 +125,7 @@ export default class AnimatedColor extends AnimatedWithChildren { let value: RgbaValue | RgbaAnimatedValue | ColorValue = valueIn ?? defaultColor; if (isRgbaAnimatedValue(value)) { - // $FlowFixMe[incompatible-cast] - Type is verified above + // $FlowFixMe[incompatible-type] - Type is verified above const rgbaAnimatedValue: RgbaAnimatedValue = (value: RgbaAnimatedValue); this.r = rgbaAnimatedValue.r; this.g = rgbaAnimatedValue.g; @@ -133,14 +133,14 @@ export default class AnimatedColor extends AnimatedWithChildren { this.a = rgbaAnimatedValue.a; } else { const processedColor: RgbaValue | NativeColorValue = - // $FlowFixMe[incompatible-cast] - Type is verified above + // $FlowFixMe[incompatible-type] - Type is verified above processColor((value: ColorValue | RgbaValue)) ?? defaultColor; let initColor: RgbaValue = defaultColor; if (isRgbaValue(processedColor)) { - // $FlowFixMe[incompatible-cast] - Type is verified above + // $FlowFixMe[incompatible-type] - Type is verified above initColor = (processedColor: RgbaValue); } else { - // $FlowFixMe[incompatible-cast] - Type is verified above + // $FlowFixMe[incompatible-type] - Type is verified above this.nativeColor = (processedColor: NativeColorValue); } @@ -203,7 +203,7 @@ export default class AnimatedColor extends AnimatedWithChildren { flushValue(this); } - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] this.__callListeners(this.__getValue()); } diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedInterpolation.js b/packages/react-native/Libraries/Animated/nodes/AnimatedInterpolation.js index 23527f82437..e49369d7597 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedInterpolation.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedInterpolation.js @@ -393,7 +393,7 @@ export default class AnimatedInterpolation< let outputRange = this._config.outputRange; let outputType = null; if (typeof outputRange[0] === 'string') { - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] outputRange = ((outputRange: $ReadOnlyArray).map(value => { const processedColor = processColor(value); if (typeof processedColor === 'number') { diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js b/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js index 52f9188e48f..0d68f7c7b37 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js @@ -43,7 +43,7 @@ function createAnimatedStyle( if (value != null && key === 'transform') { node = ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform() ? AnimatedObject.from(value) - : // $FlowFixMe[incompatible-call] - `value` is mixed. + : // $FlowFixMe[incompatible-type] - `value` is mixed. AnimatedTransform.from(value); } else if (value instanceof AnimatedNode) { node = value; diff --git a/packages/react-native/Libraries/Animated/nodes/AnimatedTransform.js b/packages/react-native/Libraries/Animated/nodes/AnimatedTransform.js index 7de7f3db47a..10ee5b1ced5 100644 --- a/packages/react-native/Libraries/Animated/nodes/AnimatedTransform.js +++ b/packages/react-native/Libraries/Animated/nodes/AnimatedTransform.js @@ -148,7 +148,7 @@ export default class AnimatedTransform extends AnimatedWithChildren { transformsConfig.push({ type: 'static', property: key, - /* $FlowFixMe[incompatible-call] - `value` can be an array or an + /* $FlowFixMe[incompatible-type] - `value` can be an array or an object. This is not currently handled by `transformDataType`. Migrating to `TransformObject` might solve this. */ value: NativeAnimatedHelper.transformDataType(value), diff --git a/packages/react-native/Libraries/AppState/AppState.js b/packages/react-native/Libraries/AppState/AppState.js index e4478fe2968..3d2da93401d 100644 --- a/packages/react-native/Libraries/AppState/AppState.js +++ b/packages/react-native/Libraries/AppState/AppState.js @@ -97,7 +97,7 @@ class AppStateImpl { // It's possible that the state will have changed here & listeners need to be notified if (!eventUpdated && this.currentState !== appStateData.app_state) { this.currentState = appStateData.app_state; - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] emitter.emit('appStateDidChange', appStateData); } }, logError); diff --git a/packages/react-native/Libraries/BatchedBridge/NativeModules.js b/packages/react-native/Libraries/BatchedBridge/NativeModules.js index 2899c27e2cd..ce6e939cfbb 100644 --- a/packages/react-native/Libraries/BatchedBridge/NativeModules.js +++ b/packages/react-native/Libraries/BatchedBridge/NativeModules.js @@ -173,7 +173,7 @@ function updateErrorWithErrorData( ): ExtendedError { /* $FlowFixMe[class-object-subtyping] added when improving typing for this * parameters */ - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] // $FlowFixMe[unsafe-object-assign] return Object.assign(error, errorData || {}); } diff --git a/packages/react-native/Libraries/Blob/BlobManager.js b/packages/react-native/Libraries/Blob/BlobManager.js index da8bbab24f7..f6b2b7bec7a 100644 --- a/packages/react-native/Libraries/Blob/BlobManager.js +++ b/packages/react-native/Libraries/Blob/BlobManager.js @@ -86,7 +86,7 @@ class BlobManager { }); const size = items.reduce((acc, curr) => { if (curr.type === 'string') { - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ return acc + global.unescape(encodeURI(curr.data)).length; } else { diff --git a/packages/react-native/Libraries/Blob/__tests__/File-test.js b/packages/react-native/Libraries/Blob/__tests__/File-test.js index a9dd70dcf90..20d8f2a75f6 100644 --- a/packages/react-native/Libraries/Blob/__tests__/File-test.js +++ b/packages/react-native/Libraries/Blob/__tests__/File-test.js @@ -26,7 +26,7 @@ describe('babel 7 smoke test', function () { class Array { constructor() { called = true; - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return {foo: 'PASS'}; } } @@ -81,9 +81,9 @@ describe('File', function () { }); it('should throw on invalid arguments', () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => new File()).toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => new File([])).toThrow(); }); }); diff --git a/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js b/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js index b177944f9dd..b6cf4e854e9 100644 --- a/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +++ b/packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js @@ -402,7 +402,7 @@ const AccessibilityInfo = { const deviceEventName = EventNames.get(eventName); return deviceEventName == null ? {remove(): void {}} - : // $FlowFixMe[incompatible-call] + : // $FlowFixMe[incompatible-type] RCTDeviceEventEmitter.addListener(deviceEventName, handler); }, diff --git a/packages/react-native/Libraries/Components/Button.js b/packages/react-native/Libraries/Components/Button.js index 8ae7433bd84..875d9b20933 100644 --- a/packages/react-native/Libraries/Components/Button.js +++ b/packages/react-native/Libraries/Components/Button.js @@ -386,7 +386,7 @@ const Button: component( touchSoundDisabled={touchSoundDisabled} // $FlowFixMe[incompatible-exact] // $FlowFixMe[prop-missing] - // $FlowFixMe[incompatible-type-arg] + // $FlowFixMe[incompatible-type] ref={ref}> diff --git a/packages/react-native/Libraries/Components/Keyboard/__tests__/Keyboard-test.js b/packages/react-native/Libraries/Components/Keyboard/__tests__/Keyboard-test.js index 916a103b8ea..a84c0becf89 100644 --- a/packages/react-native/Libraries/Components/Keyboard/__tests__/Keyboard-test.js +++ b/packages/react-native/Libraries/Components/Keyboard/__tests__/Keyboard-test.js @@ -31,7 +31,7 @@ describe('Keyboard', () => { duration: null | number, easing: null | string, ): void => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] Keyboard.scheduleLayoutAnimation({duration, easing}); it('triggers layout animation', () => { diff --git a/packages/react-native/Libraries/Components/Pressable/useAndroidRippleForView.js b/packages/react-native/Libraries/Components/Pressable/useAndroidRippleForView.js index a786da2db64..c8851fe94fc 100644 --- a/packages/react-native/Libraries/Components/Pressable/useAndroidRippleForView.js +++ b/packages/react-native/Libraries/Components/Pressable/useAndroidRippleForView.js @@ -71,9 +71,9 @@ export default function useAndroidRippleForView( return { viewProps: foreground === true - ? // $FlowFixMe[incompatible-return] + ? // $FlowFixMe[incompatible-type] {nativeForegroundAndroid: nativeRippleValue} - : // $FlowFixMe[incompatible-return] + : // $FlowFixMe[incompatible-type] {nativeBackgroundAndroid: nativeRippleValue}, onPressIn(event: GestureResponderEvent): void { const view = viewRef.current; diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js index 8f4f297ed15..60a5aa95d24 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js @@ -1169,6 +1169,7 @@ class ScrollView extends React.Component { // they are callable from the ref. // $FlowFixMe[prop-missing] - Known issue with appending custom methods. + // $FlowFixMe[incompatible-type] // $FlowFixMe[unsafe-object-assign] const publicInstance: PublicScrollViewInstance = Object.assign( nativeInstance, @@ -1834,7 +1835,7 @@ class ScrollView extends React.Component { // Note: we should split props.style on the inner and outer props // however, the ScrollView still needs the baseStyle to be scrollable const {outer, inner} = splitLayoutProps(flattenStyle(props.style)); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return cloneElement( refreshControl, {style: StyleSheet.compose(baseStyle, outer)}, diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js index d1e5d6573f0..5fb626efb56 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js @@ -78,7 +78,7 @@ const ScrollViewStickyHeader: component( setIsFabric(isFabricPublicInstance(ref)); }, []); const ref: React.RefSetter> = - // $FlowFixMe[prop-missing] - Instance is mutated to have `setNextHeaderY`. + // $FlowFixMe[incompatible-type] - Instance is mutated to have `setNextHeaderY`. useMergeRefs(callbackRef, forwardedRef); const offset = useMemo( diff --git a/packages/react-native/Libraries/Components/TextInput/TextInput.js b/packages/react-native/Libraries/Components/TextInput/TextInput.js index f9708f9cc95..9b3f0200664 100644 --- a/packages/react-native/Libraries/Components/TextInput/TextInput.js +++ b/packages/react-native/Libraries/Components/TextInput/TextInput.js @@ -487,7 +487,7 @@ function InternalTextInput(props: TextInputProps): React.Node { [mostRecentEventCount, viewCommands], ); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] const ref = useMergeRefs(setLocalRef, props.forwardedRef); const _onChange = (event: TextInputChangeEvent) => { @@ -647,7 +647,7 @@ function InternalTextInput(props: TextInputProps): React.Node { if (typeof flattenedStyle?.fontWeight === 'number') { overrides = overrides || ({}: {...TextStyleInternal}); overrides.fontWeight = - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] (flattenedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']); } @@ -768,7 +768,7 @@ function InternalTextInput(props: TextInputProps): React.Node { /* $FlowFixMe[prop-missing] the types for AndroidTextInput don't match * up exactly with the props for TextInput. This will need to get fixed */ - /* $FlowFixMe[incompatible-type-arg] the types for AndroidTextInput + /* $FlowFixMe[incompatible-type] the types for AndroidTextInput * don't match up exactly with the props for TextInput. This will need * to get fixed */ onScroll={_onScroll} diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js index 15fa6b1ec07..8ad4688a971 100755 --- a/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -282,6 +282,6 @@ export default function TouchableWithoutFeedback( } } - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return cloneElement(element, elementProps, ...children); } diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-test.js b/packages/react-native/Libraries/Components/View/__tests__/View-test.js index 2f76cbef81a..e883932df66 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-test.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-test.js @@ -97,7 +97,7 @@ describe('View compat with web', () => { 'aria-valuetext': '3', }; - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] const instance = await create(); expect(instance.toJSON()).toMatchInlineSnapshot(` diff --git a/packages/react-native/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js b/packages/react-native/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js index b5361bca4e8..0212435abff 100644 --- a/packages/react-native/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js +++ b/packages/react-native/Libraries/Core/Devtools/__tests__/parseErrorStack-test.js @@ -38,7 +38,7 @@ describe('parseErrorStack', function () { it('ignores bad inputs', function () { expect(parseErrorStack(undefined)).toEqual([]); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(parseErrorStack(null)).toEqual([]); }); }); diff --git a/packages/react-native/Libraries/Core/Devtools/loadBundleFromServer.js b/packages/react-native/Libraries/Core/Devtools/loadBundleFromServer.js index d0657e050a1..705806c7899 100644 --- a/packages/react-native/Libraries/Core/Devtools/loadBundleFromServer.js +++ b/packages/react-native/Libraries/Core/Devtools/loadBundleFromServer.js @@ -103,7 +103,7 @@ function asyncRequest( ), ); } else { - //$FlowFixMe[incompatible-call] + //$FlowFixMe[incompatible-type] resolve({body: responseText, headers}); } } diff --git a/packages/react-native/Libraries/Core/ExceptionsManager.js b/packages/react-native/Libraries/Core/ExceptionsManager.js index 413fc15dcfc..4edf111a05c 100644 --- a/packages/react-native/Libraries/Core/ExceptionsManager.js +++ b/packages/react-native/Libraries/Core/ExceptionsManager.js @@ -169,7 +169,7 @@ function handleException(e: mixed, isFatal: boolean) { inExceptionHandler = true; /* $FlowFixMe[class-object-subtyping] added when improving typing for this * parameters */ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] reportException(error, isFatal, reportToConsole); } finally { inExceptionHandler = false; @@ -259,7 +259,7 @@ function reactConsoleErrorHandler(...args) { reportException( /* $FlowFixMe[class-object-subtyping] added when improving typing for this * parameters */ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] error, isFatal, reportToConsole, diff --git a/packages/react-native/Libraries/Core/ReactFiberErrorDialog.js b/packages/react-native/Libraries/Core/ReactFiberErrorDialog.js index 47a7cd82c3d..ab77e16ee89 100644 --- a/packages/react-native/Libraries/Core/ReactFiberErrorDialog.js +++ b/packages/react-native/Libraries/Core/ReactFiberErrorDialog.js @@ -32,17 +32,17 @@ const ReactFiberErrorDialog = { if (errorValue instanceof Error) { /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] error = (errorValue: ExtendedError); } else if (typeof errorValue === 'string') { /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] error = (new SyntheticError(errorValue): ExtendedError); } else { /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] error = (new SyntheticError('Unspecified error'): ExtendedError); } try { diff --git a/packages/react-native/Libraries/Core/Timers/JSTimers.js b/packages/react-native/Libraries/Core/Timers/JSTimers.js index 6969b0e7005..febfc8810d6 100644 --- a/packages/react-native/Libraries/Core/Timers/JSTimers.js +++ b/packages/react-native/Libraries/Core/Timers/JSTimers.js @@ -473,7 +473,7 @@ let ExportedJSTimers: { if (!NativeTiming) { console.warn("Timing native module is not available, can't set timers."); - // $FlowFixMe[prop-missing] : we can assume timers are generally available + // $FlowFixMe[incompatible-type] : we can assume timers are generally available ExportedJSTimers = ({ callReactNativeMicrotasks: JSTimers.callReactNativeMicrotasks, queueReactNativeMicrotask: JSTimers.queueReactNativeMicrotask, diff --git a/packages/react-native/Libraries/Core/Timers/__tests__/JSTimers-test.js b/packages/react-native/Libraries/Core/Timers/__tests__/JSTimers-test.js index 2436043e655..3619fa53d38 100644 --- a/packages/react-native/Libraries/Core/Timers/__tests__/JSTimers-test.js +++ b/packages/react-native/Libraries/Core/Timers/__tests__/JSTimers-test.js @@ -63,9 +63,9 @@ describe('JSTimers', () => { }, 0); }, 0); JSTimers.callTimers([id1]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id2]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id3]); expect(callCount).toBe(1); @@ -87,9 +87,9 @@ describe('JSTimers', () => { }, 0); }, 0); JSTimers.callTimers([id1]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id2]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id3]); expect(callCount).toBe(1); @@ -111,9 +111,9 @@ describe('JSTimers', () => { }); }); JSTimers.callTimers([id1]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id2]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id3]); expect(callCount).toBe(1); @@ -135,9 +135,9 @@ describe('JSTimers', () => { }, 0); }, 0); JSTimers.callTimers([id1]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id2]); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] JSTimers.callTimers([id3]); expect(callCount).toBe(1); @@ -423,7 +423,7 @@ describe('JSTimers', () => { JSTimers.clearTimeout(timerID); NativeTiming.deleteTimer = jest.fn(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] JSTimers.clearTimeout(null); expect(NativeTiming.deleteTimer.mock.calls.length).toBe(0); }); diff --git a/packages/react-native/Libraries/Core/Timers/immediateShim.js b/packages/react-native/Libraries/Core/Timers/immediateShim.js index 58dab158414..ef4e87dff86 100644 --- a/packages/react-native/Libraries/Core/Timers/immediateShim.js +++ b/packages/react-native/Libraries/Core/Timers/immediateShim.js @@ -40,7 +40,7 @@ export function setImmediate(callback: Function, ...args: any): number { clearedImmediates.delete(id); } - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] global.queueMicrotask(() => { if (!clearedImmediates.has(id)) { callback.apply(undefined, args); diff --git a/packages/react-native/Libraries/Core/__tests__/ExceptionsManager-test.js b/packages/react-native/Libraries/Core/__tests__/ExceptionsManager-test.js index 58a8b93a3a8..6b560071eaf 100644 --- a/packages/react-native/Libraries/Core/__tests__/ExceptionsManager-test.js +++ b/packages/react-native/Libraries/Core/__tests__/ExceptionsManager-test.js @@ -477,7 +477,7 @@ function runExceptionsManagerTests() { expect(nativeReportException).not.toBeCalled(); expect(logBoxAddConsoleLog).toBeCalledTimes(1); expect(logBoxAddConsoleLog.mock.calls[0][0]).toBe('error'); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] expect(logBoxAddConsoleLog.mock.calls[0][1]).toBe(...args); } else { expect(logBoxAddException).not.toBeCalled(); diff --git a/packages/react-native/Libraries/Debugging/DebuggingOverlayRegistry.js b/packages/react-native/Libraries/Debugging/DebuggingOverlayRegistry.js index 958712b70bf..24da5fa088b 100644 --- a/packages/react-native/Libraries/Debugging/DebuggingOverlayRegistry.js +++ b/packages/react-native/Libraries/Debugging/DebuggingOverlayRegistry.js @@ -98,13 +98,13 @@ class DebuggingOverlayRegistry { // `canonical.publicInstance` => Fabric // $FlowExpectedError[prop-missing] if (instanceHandle.canonical?.publicInstance != null) { - // $FlowExpectedError[incompatible-return] + // $FlowExpectedError[incompatible-type] return instanceHandle.canonical?.publicInstance; } // `canonical` => Legacy Fabric if (instanceHandle.canonical != null) { - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return instanceHandle.canonical; } @@ -182,7 +182,7 @@ class DebuggingOverlayRegistry { if ( isChildPublicInstance( - // $FlowFixMe[incompatible-call] There is a lot of stuff to untangle to make types for refs work. + // $FlowFixMe[incompatible-type] There is a lot of stuff to untangle to make types for refs work. potentialParent.rootViewRef.current, // $FlowFixMe[incompatible-call] There is a lot of stuff to untangle to make types for refs work. potentialChild.rootViewRef.current, diff --git a/packages/react-native/Libraries/Image/__tests__/resolveAssetSource-test.js b/packages/react-native/Libraries/Image/__tests__/resolveAssetSource-test.js index 19b515e110e..3becf9a9055 100644 --- a/packages/react-native/Libraries/Image/__tests__/resolveAssetSource-test.js +++ b/packages/react-native/Libraries/Image/__tests__/resolveAssetSource-test.js @@ -54,7 +54,7 @@ describe('resolveAssetSource', () => { it('ignores any weird data', () => { expect(resolveAssetSource(null)).toBe(null); expect(resolveAssetSource(42)).toBe(null); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(resolveAssetSource('nonsense')).toBe(null); }); diff --git a/packages/react-native/Libraries/Image/resolveAssetSource.js b/packages/react-native/Libraries/Image/resolveAssetSource.js index 875d0eb408f..e08a6c84886 100644 --- a/packages/react-native/Libraries/Image/resolveAssetSource.js +++ b/packages/react-native/Libraries/Image/resolveAssetSource.js @@ -111,7 +111,7 @@ function addCustomSourceTransformer( function resolveAssetSource(source: ?ImageSource): ?ResolvedAssetSource { if (source == null || typeof source === 'object') { // $FlowFixMe[incompatible-exact] `source` doesn't exactly match `ResolvedAssetSource` - // $FlowFixMe[incompatible-return] `source` doesn't exactly match `ResolvedAssetSource` + // $FlowFixMe[incompatible-type] `source` doesn't exactly match `ResolvedAssetSource` return source; } diff --git a/packages/react-native/Libraries/Lists/FlatList.js b/packages/react-native/Libraries/Lists/FlatList.js index 29a22abb79b..ed708b52df6 100644 --- a/packages/react-native/Libraries/Lists/FlatList.js +++ b/packages/react-native/Libraries/Lists/FlatList.js @@ -432,7 +432,7 @@ class FlatList extends React.PureComponent> { })); } else if (this.props.onViewableItemsChanged) { this._virtualizedListPairs.push({ - /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + /* $FlowFixMe[incompatible-type] (>=0.63.0 site=react_native_fb) This * comment suppresses an error found when Flow v0.63 was deployed. To * see the error delete this comment and run Flow. */ viewabilityConfig: this.props.viewabilityConfig, @@ -569,7 +569,7 @@ class FlatList extends React.PureComponent> { .join(':'); } - // $FlowFixMe[incompatible-call] Can't call keyExtractor with an array + // $FlowFixMe[incompatible-type] Can't call keyExtractor with an array return keyExtractor(items, index); }; @@ -626,11 +626,10 @@ class FlatList extends React.PureComponent> { const render = (props: ListRenderItemInfo): React.Node => { if (ListItemComponent) { // $FlowFixMe[not-a-component] Component isn't valid - // $FlowFixMe[incompatible-type-arg] Component isn't valid - // $FlowFixMe[incompatible-return] Component isn't valid + // $FlowFixMe[incompatible-type] Component isn't valid return ; } else if (renderItem) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return renderItem(props); } else { return null; @@ -648,7 +647,7 @@ class FlatList extends React.PureComponent> { {item.map((it, kk) => { const element = render({ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] item: it, index: index * cols + kk, separators: info.separators, diff --git a/packages/react-native/Libraries/Lists/__tests__/FlatList-test.js b/packages/react-native/Libraries/Lists/__tests__/FlatList-test.js index cf4c1a232b6..157e2fa3d17 100644 --- a/packages/react-native/Libraries/Lists/__tests__/FlatList-test.js +++ b/packages/react-native/Libraries/Lists/__tests__/FlatList-test.js @@ -84,7 +84,7 @@ describe('FlatList', () => { ListHeaderComponent={() =>
} data={new Array(5).fill().map((_, ii) => ({id: String(ii)}))} keyExtractor={(item, index) => item.id} - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] getItemLayout={({index}: $FlowFixMe) => ({ length: 50, offset: index * 50, @@ -201,7 +201,7 @@ describe('FlatList', () => { const component = await create( } />, diff --git a/packages/react-native/Libraries/LogBox/Data/LogBoxData.js b/packages/react-native/Libraries/LogBox/Data/LogBoxData.js index 3ba76ae2cdf..2ce92e06354 100644 --- a/packages/react-native/Libraries/LogBox/Data/LogBoxData.js +++ b/packages/react-native/Libraries/LogBox/Data/LogBoxData.js @@ -442,7 +442,7 @@ export function withSubscription( componentDidCatch(err: Error, errorInfo: {componentStack: string, ...}) { /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] reportLogBoxError(err, errorInfo.componentStack); } diff --git a/packages/react-native/Libraries/LogBox/Data/__tests__/LogBoxData-test.js b/packages/react-native/Libraries/LogBox/Data/__tests__/LogBoxData-test.js index b2c81a8a147..bd81e5b2a52 100644 --- a/packages/react-native/Libraries/LogBox/Data/__tests__/LogBoxData-test.js +++ b/packages/react-native/Libraries/LogBox/Data/__tests__/LogBoxData-test.js @@ -671,7 +671,7 @@ describe('LogBoxData', () => { LogBoxData.reportLogBoxError( /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] new Error('Simulated Error'), ' in Component (file.js:1)', ); @@ -686,7 +686,7 @@ describe('LogBoxData', () => { it('reportLogBoxError creates a native redbox without a componentStack', () => { /* $FlowFixMe[class-object-subtyping] added when improving typing for this * parameters */ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] LogBoxData.reportLogBoxError(new Error('Simulated Error')); const receivedError = ExceptionsManager.handleException.mock.calls[0][0]; @@ -699,7 +699,7 @@ describe('LogBoxData', () => { it('reportLogBoxError creates an error message that is also ignored', () => { /* $FlowFixMe[class-object-subtyping] added when improving typing for this * parameters */ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] LogBoxData.reportLogBoxError(new Error('Simulated Error')); const receivedErrorMessage = diff --git a/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js b/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js index fb3212a142d..89b1626b8e7 100644 --- a/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js +++ b/packages/react-native/Libraries/LogBox/Data/parseLogBoxLog.js @@ -509,7 +509,7 @@ export function parseLogBoxLog(args: $ReadOnlyArray): { return { ...parseInterpolation(argsWithoutComponentStack), componentStack, - /* $FlowFixMe[incompatible-return] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ componentStackType, }; diff --git a/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js b/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js index 678a9b0f186..9826f1c9471 100644 --- a/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +++ b/packages/react-native/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js @@ -42,7 +42,7 @@ function LogBoxInspectorSourceMapStatus(props: Props): React.Node { useNativeDriver: true, }), ); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] setState({ animation, rotate: animated.interpolate({ diff --git a/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorStackFrames-test.js b/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorStackFrames-test.js index 1b7e4dd8533..46b3b6f2d23 100644 --- a/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorStackFrames-test.js +++ b/packages/react-native/Libraries/LogBox/UI/__tests__/LogBoxInspectorStackFrames-test.js @@ -90,7 +90,7 @@ describe('LogBoxInspectorStackFrames', () => { expect( getCollapseMessage( createCollapsedFrames( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] [stackOne, stackTwo, stackThree].filter(i => i != null), ), collapsed, diff --git a/packages/react-native/Libraries/Modal/Modal.js b/packages/react-native/Libraries/Modal/Modal.js index d1da4166414..eb0e1a92541 100644 --- a/packages/react-native/Libraries/Modal/Modal.js +++ b/packages/react-native/Libraries/Modal/Modal.js @@ -370,13 +370,13 @@ const styles = StyleSheet.create({ modal: { position: 'absolute', }, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ container: { /* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb) This * comment suppresses an error found when Flow v0.111 was deployed. To see * the error, delete this comment and run Flow. */ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] [side]: 0, top: 0, flex: 1, diff --git a/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js b/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js index 84f77f5b8e7..6152ffa2e81 100644 --- a/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js +++ b/packages/react-native/Libraries/NativeComponent/NativeComponentRegistry.js @@ -108,7 +108,7 @@ export function get( return viewConfig; }); - // $FlowFixMe[incompatible-return] `NativeComponent` is actually string! + // $FlowFixMe[incompatible-type] `NativeComponent` is actually string! return name; } diff --git a/packages/react-native/Libraries/NativeComponent/ViewConfig.js b/packages/react-native/Libraries/NativeComponent/ViewConfig.js index 9dae3155a9a..857db000cb3 100644 --- a/packages/react-native/Libraries/NativeComponent/ViewConfig.js +++ b/packages/react-native/Libraries/NativeComponent/ViewConfig.js @@ -32,7 +32,7 @@ export function createViewConfig( PlatformBaseViewConfig.directEventTypes, partialViewConfig.directEventTypes, ), - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] validAttributes: composeIndexers( // $FlowFixMe[incompatible-call] `style` property confuses Flow. PlatformBaseViewConfig.validAttributes, diff --git a/packages/react-native/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js b/packages/react-native/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js index 5c4a13ac13e..101294d9647 100644 --- a/packages/react-native/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js +++ b/packages/react-native/Libraries/NativeComponent/__tests__/StaticViewConfigValidator-test.js @@ -81,10 +81,10 @@ test('passes for identical configs', () => { const validationResult = StaticViewConfigValidator.validate( name, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ nativeViewConfig, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ staticViewConfig, ); @@ -206,7 +206,7 @@ test('allows static viewconfigs to have more properties than native viewconfigs' const validationResult = StaticViewConfigValidator.validate( name, nativeViewConfig, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ staticViewConfig, ); diff --git a/packages/react-native/Libraries/Network/RCTNetworking.android.js b/packages/react-native/Libraries/Network/RCTNetworking.android.js index a957a09a4a2..626d3dfcfcc 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.android.js +++ b/packages/react-native/Libraries/Network/RCTNetworking.android.js @@ -53,7 +53,7 @@ const RCTNetworking = { listener: (...RCTNetworkingEventDefinitions[K]) => mixed, context?: mixed, ): EventSubscription { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return emitter.addListener(eventType, listener, context); }, diff --git a/packages/react-native/Libraries/Network/RCTNetworking.ios.js b/packages/react-native/Libraries/Network/RCTNetworking.ios.js index dcabadec9fd..ee9364e5b50 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.ios.js +++ b/packages/react-native/Libraries/Network/RCTNetworking.ios.js @@ -23,7 +23,7 @@ const RCTNetworking = { listener: (...RCTNetworkingEventDefinitions[K]) => mixed, context?: mixed, ): EventSubscription { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return RCTDeviceEventEmitter.addListener(eventType, listener, context); }, diff --git a/packages/react-native/Libraries/Network/__tests__/FormData-test.js b/packages/react-native/Libraries/Network/__tests__/FormData-test.js index d2fc1d67fc3..36a290ee374 100644 --- a/packages/react-native/Libraries/Network/__tests__/FormData-test.js +++ b/packages/react-native/Libraries/Network/__tests__/FormData-test.js @@ -18,7 +18,7 @@ describe('FormData', function () { }); it('should return non blob null', function () { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] formData.append('null', null); const expectedPart = { @@ -73,7 +73,7 @@ describe('FormData', function () { }); it('should return non blob array', function () { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] formData.append('array', [ true, false, diff --git a/packages/react-native/Libraries/Network/__tests__/XMLHttpRequest-test.js b/packages/react-native/Libraries/Network/__tests__/XMLHttpRequest-test.js index 584bcfa0527..f80f71a7508 100644 --- a/packages/react-native/Libraries/Network/__tests__/XMLHttpRequest-test.js +++ b/packages/react-native/Libraries/Network/__tests__/XMLHttpRequest-test.js @@ -169,7 +169,7 @@ describe('XMLHttpRequest', function () { xhr.open('GET', 'blabla'); xhr.send(); setRequestId(4); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] xhr.__didCompleteResponse(requestId, 'Generic error'); expect(xhr.readyState).toBe(xhr.DONE); @@ -191,7 +191,7 @@ describe('XMLHttpRequest', function () { xhr.open('GET', 'blabla'); xhr.send(); setRequestId(5); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] xhr.__didCompleteResponse(requestId, null); expect(xhr.readyState).toBe(xhr.DONE); diff --git a/packages/react-native/Libraries/Network/convertRequestBody.js b/packages/react-native/Libraries/Network/convertRequestBody.js index 3914670ba6e..caf79174078 100644 --- a/packages/react-native/Libraries/Network/convertRequestBody.js +++ b/packages/react-native/Libraries/Network/convertRequestBody.js @@ -36,7 +36,7 @@ function convertRequestBody(body: RequestBody): Object { return {formData: body.getParts()}; } if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) { - /* $FlowFixMe[incompatible-call] : no way to assert that 'body' is indeed + /* $FlowFixMe[incompatible-type] : no way to assert that 'body' is indeed * an ArrayBufferView */ return {base64: binaryToBase64(body)}; } diff --git a/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js b/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js index 9f18c463371..8fe33fb73e4 100644 --- a/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js +++ b/packages/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js @@ -262,13 +262,13 @@ class PermissionsAndroidImpl { options, () => reject(new Error('Error showing rationale')), () => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] resolve(NativePermissionsAndroid.requestPermission(permission)), ); }); } } - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return NativePermissionsAndroid.requestPermission(permission); } @@ -293,8 +293,7 @@ class PermissionsAndroidImpl { NativePermissionsAndroid, 'PermissionsAndroid is not installed correctly.', ); - // $FlowFixMe[incompatible-return] - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return NativePermissionsAndroid.requestMultiplePermissions(permissions); } } diff --git a/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js b/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js index 2e71f02b141..26e1dacfb47 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js +++ b/packages/react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js @@ -210,7 +210,7 @@ class PushNotificationIOS { NativePushNotificationManagerIOS, 'PushNotificationManager is not available.', ); - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] NativePushNotificationManagerIOS.presentLocalNotification(details); } @@ -235,7 +235,7 @@ class PushNotificationIOS { NativePushNotificationManagerIOS, 'PushNotificationManager is not available.', ); - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] NativePushNotificationManagerIOS.scheduleLocalNotification(details); } diff --git a/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js b/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js index 2c861674e69..aded8e28178 100644 --- a/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +++ b/packages/react-native/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js @@ -132,7 +132,7 @@ export function getNodeFromPublicInstance( RendererProxy = require('../../ReactNative/RendererProxy'); } return RendererProxy.getNodeFromInternalInstanceHandle( - // $FlowExpectedError[incompatible-call] __internalInstanceHandle is always an InternalInstanceHandle from React when we get here. + // $FlowExpectedError[incompatible-type] __internalInstanceHandle is always an InternalInstanceHandle from React when we get here. publicInstance.__internalInstanceHandle, ); } @@ -143,10 +143,10 @@ export function getInternalInstanceHandleFromPublicInstance( // TODO(T174762768): Remove this once OSS versions of renderers will be synced. // $FlowExpectedError[prop-missing] Keeping this for backwards-compatibility with the renderers versions in open source. if (publicInstance._internalInstanceHandle != null) { - // $FlowExpectedError[incompatible-return] Keeping this for backwards-compatibility with the renderers versions in open source. + // $FlowExpectedError[incompatible-type] Keeping this for backwards-compatibility with the renderers versions in open source. return publicInstance._internalInstanceHandle; } - // $FlowExpectedError[incompatible-return] __internalInstanceHandle is always an InternalInstanceHandle from React when we get here. + // $FlowExpectedError[incompatible-type] __internalInstanceHandle is always an InternalInstanceHandle from React when we get here. return publicInstance.__internalInstanceHandle; } diff --git a/packages/react-native/Libraries/ReactNative/RendererImplementation.js b/packages/react-native/Libraries/ReactNative/RendererImplementation.js index 2736d8a0aec..9f8b692eb20 100644 --- a/packages/react-native/Libraries/ReactNative/RendererImplementation.js +++ b/packages/react-native/Libraries/ReactNative/RendererImplementation.js @@ -60,21 +60,21 @@ export function renderElement({ } export function findHostInstance_DEPRECATED( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] componentOrHandle: ?(React.ElementRef | number), ): ?HostInstance { return require('../Renderer/shims/ReactNative').default.findHostInstance_DEPRECATED( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] componentOrHandle, ); } export function findNodeHandle( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] componentOrHandle: ?(React.ElementRef | number), ): ?number { return require('../Renderer/shims/ReactNative').default.findNodeHandle( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] componentOrHandle, ); } diff --git a/packages/react-native/Libraries/ReactNative/UIManager.js b/packages/react-native/Libraries/ReactNative/UIManager.js index 0910b6d3883..3d272953028 100644 --- a/packages/react-native/Libraries/ReactNative/UIManager.js +++ b/packages/react-native/Libraries/ReactNative/UIManager.js @@ -45,7 +45,7 @@ const UIManager: UIManagerJSInterface = { FabricUIManager.measure(shadowNode, callback); } else { console.warn(`measure cannot find view with tag #${reactTag}`); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] callback(); } } else { @@ -71,7 +71,7 @@ const UIManager: UIManagerJSInterface = { FabricUIManager.measureInWindow(shadowNode, callback); } else { console.warn(`measure cannot find view with tag #${reactTag}`); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] callback(); } } else { @@ -182,7 +182,7 @@ const UIManager: UIManagerJSInterface = { UIManagerImpl.dispatchViewManagerCommand( reactTag, // We have some legacy components that are actually already using strings. ¯\_(ツ)_/¯ - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] commandName, commandArgs, ); diff --git a/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js b/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js index 3caf81f8c06..5cbc624ecea 100644 --- a/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js +++ b/packages/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js @@ -86,7 +86,7 @@ module.exports = { // TODO: Remove when React has migrated to `createAttributePayload` and `diffAttributePayloads` get flattenStyle(): flattenStyle { // $FlowFixMe[underconstrained-implicit-instantiation] - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return require('../StyleSheet/flattenStyle').default; }, get ReactFiberErrorDialog(): ReactFiberErrorDialog { diff --git a/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.android.js b/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.android.js index 1d5fbe8fe41..661773de396 100644 --- a/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.android.js +++ b/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.android.js @@ -17,7 +17,7 @@ type LocalNativeColorValue = { }; export const PlatformColor = (...names: Array): ColorValue => { - /* $FlowExpectedError[incompatible-return] + /* $FlowExpectedError[incompatible-type] * LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */ return ({resource_paths: names}: LocalNativeColorValue); }; @@ -25,7 +25,7 @@ export const PlatformColor = (...names: Array): ColorValue => { export const normalizeColorObject = ( color: NativeColorValue, ): ?ProcessedColorValue => { - /* $FlowExpectedError[incompatible-cast] + /* $FlowExpectedError[incompatible-type] * LocalNativeColorValue is the actual type of the opaque NativeColorValue on Android platform */ if ('resource_paths' in (color: LocalNativeColorValue)) { return color; diff --git a/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js b/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js index 81f479155ed..8e73e26b6a0 100644 --- a/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js +++ b/packages/react-native/Libraries/StyleSheet/PlatformColorValueTypes.ios.js @@ -23,7 +23,7 @@ type LocalNativeColorValue = { }; export const PlatformColor = (...names: Array): ColorValue => { - // $FlowExpectedError[incompatible-return] LocalNativeColorValue is the iOS LocalNativeColorValue type + // $FlowExpectedError[incompatible-type] LocalNativeColorValue is the iOS LocalNativeColorValue type return ({semantic: names}: LocalNativeColorValue); }; @@ -44,7 +44,7 @@ export const DynamicColorIOSPrivate = ( highContrastLight: tuple.highContrastLight, highContrastDark: tuple.highContrastDark, }, - /* $FlowExpectedError[incompatible-return] + /* $FlowExpectedError[incompatible-type] * LocalNativeColorValue is the actual type of the opaque NativeColorValue on iOS platform */ }: LocalNativeColorValue); }; diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/flattenStyle-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/flattenStyle-test.js index e089385feb8..3d42d302dab 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/flattenStyle-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/flattenStyle-test.js @@ -150,7 +150,7 @@ describe('flattenStyle', () => { it('should ignore invalid class names', () => { // $FlowExpectedError[extra-arg] - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] const invalid = flattenStyle(1234, null); expect(invalid).toEqual(undefined); diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js index 3014ed798be..d4fd8cf122d 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/processAspectRatio-test.js @@ -49,7 +49,7 @@ describe('processAspectRatio', () => { it('should ignore non string falsy types', () => { const invalidThings = [undefined, null, false]; for (const thing of invalidThings) { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(processAspectRatio(thing)).toBe(undefined); } }); @@ -57,7 +57,7 @@ describe('processAspectRatio', () => { it('should not accept non string truthy types', () => { const invalidThings = [() => {}, [1, 2, 3], {}]; for (const thing of invalidThings) { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => processAspectRatio(thing)).toThrowErrorMatchingSnapshot(); } }); diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/processBackgroundImage-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/processBackgroundImage-test.js index 778dc1f4cb9..91c8207eb8f 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/processBackgroundImage-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/processBackgroundImage-test.js @@ -709,7 +709,7 @@ describe('processBackgroundImage', () => { colorStops: [{color: 'red'}, {positions: ['20%']}, {color: 'blue'}], }, ]; - // $FlowFixMe[incompatible-call] - `positions` is missing types. + // $FlowFixMe[incompatible-type] - `positions` is missing types. const result = processBackgroundImage(input); expect(result[0].type).toBe('linear-gradient'); expect(result[0].direction).toEqual({type: 'angle', value: 180}); @@ -741,7 +741,7 @@ describe('processBackgroundImage', () => { expect(result).toEqual([]); // Invalid object syntax - // $FlowFixMe[incompatible-call] - `positions` is missing types. + // $FlowFixMe[incompatible-type] - `positions` is missing types. result = processBackgroundImage([ { type: 'linear-gradient' as const, @@ -781,7 +781,7 @@ describe('processBackgroundImage', () => { ], }, ]; - // $FlowFixMe[incompatible-call] - `positions` is missing types. + // $FlowFixMe[incompatible-type] - `positions` is missing types. const result = processBackgroundImage(input); expect(result[0].colorStops).toEqual([ {color: processColor('red'), position: null}, @@ -889,7 +889,7 @@ describe('processBackgroundImage', () => { ], }, ]; - // $FlowFixMe[incompatible-call] - `positions` is missing types. + // $FlowFixMe[incompatible-type] - `positions` is missing types. const result1 = processBackgroundImage(input1); expect(result1[0].colorStops).toEqual([ {color: processColor('red'), position: '10%'}, @@ -925,7 +925,7 @@ describe('processBackgroundImage', () => { }, }, ]; - // $FlowFixMe[incompatible-call] - `positions` is missing types. + // $FlowFixMe[incompatible-type] - `positions` is missing types. const result = processBackgroundImage(input); expect(result[0].colorStops).toEqual([ {color: processColor('red'), position: '10%'}, diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/processColorArray-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/processColorArray-test.js index 55cfb5faa8a..6d04bdb3017 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/processColorArray-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/processColorArray-test.js @@ -46,7 +46,7 @@ describe('processColorArray', () => { const expectedIntArray = [0xff0a141e, 0xff1e140a, 0xff3296fa].map( platformSpecific, ); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] expect(colorFromRGBArray).toEqual(platformSpecific(expectedIntArray)); }); @@ -59,7 +59,7 @@ describe('processColorArray', () => { const expectedIntArray = [0xffdb3dac, 0xff234786, 0xff1e541d].map( platformSpecific, ); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] expect(colorFromHSLArray).toEqual(platformSpecific(expectedIntArray)); }); @@ -72,7 +72,7 @@ describe('processColorArray', () => { const spy = jest.spyOn(console, 'error').mockReturnValue(undefined); const colors = ['red', '???', null, undefined, false]; - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] const colorFromStringArray = processColorArray(colors); const expectedIntArray = [ 0xffff0000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/processFilter-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/processFilter-test.js index 26e598c4840..a80a62c963d 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/processFilter-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/processFilter-test.js @@ -102,11 +102,11 @@ describe('processFilter', () => { expect(processFilter([])).toEqual([]); }); it('Non filter', () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(processFilter([{foo: 5}])).toEqual([]); }); it('Invalid amount type', () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(processFilter([{brightness: {}}])).toEqual([]); }); it('string multiple filters', () => { @@ -398,7 +398,7 @@ function testDropShadow() { it('should fail on invalid object drop-shadow', () => { expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] processFilter([ {dropShadow: {offsetX: 4, offsetY: 5, invalid: 'invalid arg'}}, ]), @@ -407,7 +407,7 @@ function testDropShadow() { it('should fail on invalid argument for drop-shadow object', () => { expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] processFilter([{dropShadow: 8}]), ).toEqual([]); }); diff --git a/packages/react-native/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js b/packages/react-native/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js index 5ed446b3d1b..03ab1e957f1 100644 --- a/packages/react-native/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js +++ b/packages/react-native/Libraries/StyleSheet/__tests__/setNormalizedColorAlpha-test.js @@ -28,7 +28,7 @@ describe('setNormalizedColorAlpha', () => { it('should return the original color when alpha is unchanged', () => { const originalColor = normalizeColor('blue'); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] expect(setNormalizedColorAlpha(originalColor, 1)).toBe(originalColor); }); }); diff --git a/packages/react-native/Libraries/StyleSheet/flattenStyle.js b/packages/react-native/Libraries/StyleSheet/flattenStyle.js index 3353d039abf..f367f693d76 100644 --- a/packages/react-native/Libraries/StyleSheet/flattenStyle.js +++ b/packages/react-native/Libraries/StyleSheet/flattenStyle.js @@ -31,7 +31,7 @@ function flattenStyle< } if (!Array.isArray(style)) { - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return style; } @@ -49,7 +49,7 @@ function flattenStyle< } } } - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return result; } diff --git a/packages/react-native/Libraries/Text/Text.js b/packages/react-native/Libraries/Text/Text.js index 6c4764e1585..f6020fa7776 100644 --- a/packages/react-native/Libraries/Text/Text.js +++ b/packages/react-native/Libraries/Text/Text.js @@ -170,7 +170,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) { if (typeof processedStyle.fontWeight === 'number') { overrides = overrides || ({}: {...TextStyleInternal}); overrides.fontWeight = - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] (String(processedStyle.fontWeight): TextStyleInternal['fontWeight']); } @@ -409,7 +409,7 @@ if (ReactNativeFeatureFlags.reduceDefaultPropsInText()) { if (typeof processedStyle.fontWeight === 'number') { overrides = overrides || ({}: {...TextStyleInternal}); overrides.fontWeight = - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] (processedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']); } diff --git a/packages/react-native/Libraries/Text/TextNativeComponent.js b/packages/react-native/Libraries/Text/TextNativeComponent.js index 709dd5613ed..fde3ef5baf7 100644 --- a/packages/react-native/Libraries/Text/TextNativeComponent.js +++ b/packages/react-native/Libraries/Text/TextNativeComponent.js @@ -67,7 +67,7 @@ const virtualTextViewConfig = { export const NativeText: HostComponent = (createReactNativeComponentClass('RCTText', () => - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ createViewConfig(textViewConfig), ): any); @@ -76,7 +76,7 @@ export const NativeVirtualText: HostComponent = !global.RN$Bridgeless && !UIManager.hasViewManagerConfig('RCTVirtualText') ? NativeText : (createReactNativeComponentClass('RCTVirtualText', () => - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ createViewConfig(virtualTextViewConfig), ): any); diff --git a/packages/react-native/Libraries/Text/__tests__/Text-test.js b/packages/react-native/Libraries/Text/__tests__/Text-test.js index e42d6d183a5..10fb78ec853 100644 --- a/packages/react-native/Libraries/Text/__tests__/Text-test.js +++ b/packages/react-native/Libraries/Text/__tests__/Text-test.js @@ -56,7 +56,7 @@ describe('Text compat with web', () => { testID: 'testID', }; - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] const instance = await create(); expect(omitRefAndFlattenStyle(instance)).toMatchInlineSnapshot(` diff --git a/packages/react-native/Libraries/Utilities/Platform.android.js b/packages/react-native/Libraries/Utilities/Platform.android.js index b55c0191621..0883c5a2783 100644 --- a/packages/react-native/Libraries/Utilities/Platform.android.js +++ b/packages/react-native/Libraries/Utilities/Platform.android.js @@ -72,12 +72,12 @@ const Platform: PlatformType = { }, select: (spec: PlatformSelectSpec): T => 'android' in spec - ? // $FlowFixMe[incompatible-return] + ? // $FlowFixMe[incompatible-type] spec.android : 'native' in spec - ? // $FlowFixMe[incompatible-return] + ? // $FlowFixMe[incompatible-type] spec.native - : // $FlowFixMe[incompatible-return] + : // $FlowFixMe[incompatible-type] spec.default, }; diff --git a/packages/react-native/Libraries/Utilities/Platform.ios.js b/packages/react-native/Libraries/Utilities/Platform.ios.js index 81cfd77914c..5a985f9feff 100644 --- a/packages/react-native/Libraries/Utilities/Platform.ios.js +++ b/packages/react-native/Libraries/Utilities/Platform.ios.js @@ -78,7 +78,7 @@ const Platform: PlatformType = { return this.constants.isMacCatalyst ?? false; }, select: (spec: PlatformSelectSpec): T => - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] 'ios' in spec ? spec.ios : 'native' in spec ? spec.native : spec.default, }; diff --git a/packages/react-native/Libraries/Utilities/__tests__/PixelRatio-test.js b/packages/react-native/Libraries/Utilities/__tests__/PixelRatio-test.js index f4b5c36ab24..962c5014de4 100644 --- a/packages/react-native/Libraries/Utilities/__tests__/PixelRatio-test.js +++ b/packages/react-native/Libraries/Utilities/__tests__/PixelRatio-test.js @@ -34,7 +34,7 @@ describe('PixelRatio', () => { it('should give the pixel density instead of the font scale when the front scale is not present', () => { Dimensions.set({ - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] windowPhysicalPixels: { scale: 2, }, diff --git a/packages/react-native/Libraries/Utilities/__tests__/binaryToBase64-test.js b/packages/react-native/Libraries/Utilities/__tests__/binaryToBase64-test.js index c40910878ae..3e00f9170ae 100644 --- a/packages/react-native/Libraries/Utilities/__tests__/binaryToBase64-test.js +++ b/packages/react-native/Libraries/Utilities/__tests__/binaryToBase64-test.js @@ -33,7 +33,7 @@ describe('binaryToBase64', () => { it('should not encode a non-ArrayBuffer or non-TypedArray', () => { const input = ['i', 'n', 'v', 'a', 'l', 'i', 'd']; - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => binaryToBase64(input)).toThrowError(); }); }); @@ -41,6 +41,6 @@ describe('binaryToBase64', () => { function base64ToString(base64String: string) { const byteArray = base64.toByteArray(base64String); - // $FlowFixMe[incompatible-call] - `TextEncoder` constructor type is wrong. + // $FlowFixMe[incompatible-type] - `TextEncoder` constructor type is wrong. return new TextDecoder().decode(byteArray); } diff --git a/packages/react-native/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js b/packages/react-native/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js index efa5603bb8b..4188a7bef10 100644 --- a/packages/react-native/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js +++ b/packages/react-native/Libraries/Utilities/__tests__/deepFreezeAndThrowOnMutationInDev-test.js @@ -14,26 +14,26 @@ const deepFreezeAndThrowOnMutationInDev = describe('deepFreezeAndThrowOnMutationInDev', () => { it('should be a noop on non-object values', () => { __DEV__ = true; - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev('')).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev(null)).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev(false)).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev(5)).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev()).not.toThrow(); __DEV__ = false; - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev('')).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev(null)).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev(false)).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev(5)).not.toThrow(); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev()).not.toThrow(); }); @@ -42,7 +42,7 @@ describe('deepFreezeAndThrowOnMutationInDev', () => { const o = Object.create(null); // $FlowExpectedError[prop-missing] o.key = 'Value'; - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(() => deepFreezeAndThrowOnMutationInDev(o)).not.toThrow(); }); diff --git a/packages/react-native/Libraries/Utilities/codegenNativeCommands.js b/packages/react-native/Libraries/Utilities/codegenNativeCommands.js index 056b1ca302c..6f9c0a115a1 100644 --- a/packages/react-native/Libraries/Utilities/codegenNativeCommands.js +++ b/packages/react-native/Libraries/Utilities/codegenNativeCommands.js @@ -22,7 +22,7 @@ function codegenNativeCommands( options.supportedCommands.forEach(command => { // $FlowFixMe[missing-local-annot] commandObj[command] = (ref, ...args) => { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] dispatchCommand(ref, command, args); }; }); diff --git a/packages/react-native/Libraries/Utilities/codegenNativeComponent.js b/packages/react-native/Libraries/Utilities/codegenNativeComponent.js index 1922f6f5b29..9cd3d2d2eda 100644 --- a/packages/react-native/Libraries/Utilities/codegenNativeComponent.js +++ b/packages/react-native/Libraries/Utilities/codegenNativeComponent.js @@ -65,7 +65,7 @@ function codegenNativeComponent( } return (requireNativeComponent( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] componentNameInUse, ): HostComponent); } diff --git a/packages/react-native/Libraries/vendor/emitter/EventEmitter.js b/packages/react-native/Libraries/vendor/emitter/EventEmitter.js index 01dcd481796..236f963dc08 100644 --- a/packages/react-native/Libraries/vendor/emitter/EventEmitter.js +++ b/packages/react-native/Libraries/vendor/emitter/EventEmitter.js @@ -126,7 +126,7 @@ export default class EventEmitter< // Copy `registrations` to take a snapshot when we invoke `emit`, in case // registrations are added or removed when listeners are invoked. for (const registration of Array.from(registrations)) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] registration.listener.apply(registration.context, args); } } diff --git a/packages/react-native/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js b/packages/react-native/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js index eb1a135eb2f..99738ca7160 100644 --- a/packages/react-native/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js +++ b/packages/react-native/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js @@ -63,7 +63,7 @@ subscription.once; // $FlowExpectedError[invalid-tuple-arity] emitter.emit('void', undefined); -// $FlowExpectedError[incompatible-call] +// $FlowExpectedError[incompatible-type] emitter.emit('string', 123); // $FlowExpectedError[invalid-tuple-arity] emitter.emit('strings', 'foo'); diff --git a/packages/react-native/jest/mock.js b/packages/react-native/jest/mock.js index 5b00870d861..78f56bfc470 100644 --- a/packages/react-native/jest/mock.js +++ b/packages/react-native/jest/mock.js @@ -34,6 +34,6 @@ export default function mock>( } function deref(ref: $Flow$ModuleRef): string { - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] return (ref as string).substring(2); } diff --git a/packages/react-native/jest/mockComponent.js b/packages/react-native/jest/mockComponent.js index b3fc475ed47..24c57696f00 100644 --- a/packages/react-native/jest/mockComponent.js +++ b/packages/react-native/jest/mockComponent.js @@ -99,6 +99,6 @@ export default function mockComponent< Object.assign(Component.prototype, instanceMethods); } - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return Component; } diff --git a/packages/react-native/jest/mocks/ScrollView.js b/packages/react-native/jest/mocks/ScrollView.js index 62f50b052d5..3414d0833c0 100644 --- a/packages/react-native/jest/mocks/ScrollView.js +++ b/packages/react-native/jest/mocks/ScrollView.js @@ -44,7 +44,7 @@ const BaseComponent = mockComponent( true, // isESModule ) as TScrollView; -// $FlowFixMe[incompatible-extend] +// $FlowFixMe[incompatible-type] // $FlowFixMe[invalid-exported-annotation] export default class ScrollViewMock extends BaseComponent { render(): React.Node { diff --git a/packages/react-native/jest/setup.js b/packages/react-native/jest/setup.js index 5f75f2826b7..e2ca79a151d 100644 --- a/packages/react-native/jest/setup.js +++ b/packages/react-native/jest/setup.js @@ -81,7 +81,7 @@ jest.mock('prettier', () => { return module.prototype.require(require.resolve('prettier')); }); -// $FlowFixMe[incompatible-call] - `./mocks/AppState` is incomplete. +// $FlowFixMe[incompatible-type] - `./mocks/AppState` is incomplete. mock('m#../Libraries/AppState/AppState', 'm#./mocks/AppState'); mock('m#../Libraries/BatchedBridge/NativeModules', 'm#./mocks/NativeModules'); mock( @@ -95,41 +95,41 @@ mock( mock('m#../Libraries/Components/Clipboard/Clipboard', 'm#./mocks/Clipboard'); mock( 'm#../Libraries/Components/RefreshControl/RefreshControl', - // $FlowFixMe[incompatible-call] - `../Libraries/Components/RefreshControl/RefreshControl` should export a component type. + // $FlowFixMe[incompatible-type] - `../Libraries/Components/RefreshControl/RefreshControl` should export a component type. 'm#./mocks/RefreshControl', ); // $FlowFixMe[incompatible-exact] - `../Libraries/Components/ScrollView/ScrollView` is... I don't even. -// $FlowFixMe[prop-missing] +// $FlowFixMe[incompatible-type] mock('m#../Libraries/Components/ScrollView/ScrollView', 'm#./mocks/ScrollView'); mock('m#../Libraries/Components/TextInput/TextInput', 'm#./mocks/TextInput'); mock('m#../Libraries/Components/View/View', 'm#./mocks/View'); mock( 'm#../Libraries/Components/View/ViewNativeComponent', - // $FlowFixMe[incompatible-call] - `./mocks/ViewNativeComponent` is incomplete. + // $FlowFixMe[incompatible-type] - `./mocks/ViewNativeComponent` is incomplete. // $FlowFixMe[prop-missing] 'm#./mocks/ViewNativeComponent', ); mock('m#../Libraries/Core/InitializeCore', 'm#./mocks/InitializeCore'); mock('m#../Libraries/Core/NativeExceptionsManager'); mock('m#../Libraries/Image/Image', 'm#./mocks/Image'); -// $FlowFixMe[incompatible-call] - `./mocks/Linking` is incomplete. +// $FlowFixMe[incompatible-type] - `./mocks/Linking` is incomplete. mock('m#../Libraries/Linking/Linking', 'm#./mocks/Linking'); -// $FlowFixMe[incompatible-call] - `../Libraries/Modal/Modal` should export a component type. +// $FlowFixMe[incompatible-type] - `../Libraries/Modal/Modal` should export a component type. mock('m#../Libraries/Modal/Modal', 'm#./mocks/Modal'); mock( 'm#../Libraries/NativeComponent/NativeComponentRegistry', - // $FlowFixMe[prop-missing] - `./mocks/NativeComponentRegistry` should export named functions. + // $FlowFixMe[incompatible-type] - `./mocks/NativeComponentRegistry` should export named functions. 'm#./mocks/NativeComponentRegistry', ); -// $FlowFixMe[prop-missing] - `./mocks/RendererProxy` is incomplete. +// $FlowFixMe[incompatible-type] - `./mocks/RendererProxy` is incomplete. mock('m#../Libraries/ReactNative/RendererProxy', 'm#./mocks/RendererProxy'); mock( 'm#../Libraries/ReactNative/requireNativeComponent', 'm#./mocks/requireNativeComponent', ); -// $FlowFixMe[prop-missing] - `./mocks/UIManager` is incomplete. +// $FlowFixMe[incompatible-type] - `./mocks/UIManager` is incomplete. mock('m#../Libraries/ReactNative/UIManager', 'm#./mocks/UIManager'); mock('m#../Libraries/Text/Text', 'm#./mocks/Text'); mock('m#../Libraries/Utilities/useColorScheme', 'm#./mocks/useColorScheme'); -// $FlowFixMe[incompatible-call] +// $FlowFixMe[incompatible-type] mock('m#../Libraries/Vibration/Vibration', 'm#./mocks/Vibration'); diff --git a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js index 2137c5f9eab..6ed651bb7ab 100644 --- a/packages/react-native/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js +++ b/packages/react-native/scripts/codegen/generate-artifacts-executor/generateSchemaInfos.js @@ -19,7 +19,7 @@ const path = require('path'); function generateSchemaInfos( libraries /*: $ReadOnlyArray<$FlowFixMe> */, ) /*: Array<$FlowFixMe> */ { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return libraries.map(generateSchemaInfo); } diff --git a/packages/react-native/scripts/codegen/generate-specs-cli-executor.js b/packages/react-native/scripts/codegen/generate-specs-cli-executor.js index 119fd2b64ce..e85e8361a2d 100644 --- a/packages/react-native/scripts/codegen/generate-specs-cli-executor.js +++ b/packages/react-native/scripts/codegen/generate-specs-cli-executor.js @@ -120,7 +120,7 @@ function generateSpec( packageName /*: string */, libraryType /*: string */, ) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] generateSpecFromInMemorySchema( platform, readAndParseSchema(schemaPath), diff --git a/packages/react-native/src/private/animated/NativeAnimatedHelper.js b/packages/react-native/src/private/animated/NativeAnimatedHelper.js index a8253b20f72..c8a1bec49d2 100644 --- a/packages/react-native/src/private/animated/NativeAnimatedHelper.js +++ b/packages/react-native/src/private/animated/NativeAnimatedHelper.js @@ -127,7 +127,7 @@ function createNativeOperations(): $NonMaybeType { }; } } - // $FlowExpectedError[incompatible-return] - Dynamism. + // $FlowExpectedError[incompatible-type] - Dynamism. return nativeOperations; } @@ -145,7 +145,7 @@ const API = { if (saveValueCallback) { eventListenerGetValueCallbacks[tag] = saveValueCallback; } - /* $FlowExpectedError[incompatible-call] - `saveValueCallback` is handled + /* $FlowExpectedError[incompatible-type] - `saveValueCallback` is handled differently when `isSingleOpBatching` is enabled. */ NativeOperations.getValue(tag); } @@ -271,7 +271,7 @@ const API = { if (endCallback) { eventListenerAnimationFinishedCallbacks[animationId] = endCallback; } - /* $FlowExpectedError[incompatible-call] - `endCallback` is handled + /* $FlowExpectedError[incompatible-type] - `endCallback` is handled differently when `isSingleOpBatching` is enabled. */ NativeOperations.startAnimatingNode(animationId, nodeTag, config); } diff --git a/packages/react-native/src/private/animated/__tests__/AnimatedNative-test.js b/packages/react-native/src/private/animated/__tests__/AnimatedNative-test.js index 48fc0474a71..35a3158e79f 100644 --- a/packages/react-native/src/private/animated/__tests__/AnimatedNative-test.js +++ b/packages/react-native/src/private/animated/__tests__/AnimatedNative-test.js @@ -990,7 +990,7 @@ describe('Native Animated', () => { const propA = new Animated.Value(0); const propB = new Animated.Value(0); - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] await create(); Animated.timing(propA, { diff --git a/packages/react-native/src/private/animated/createAnimatedPropsHook.js b/packages/react-native/src/private/animated/createAnimatedPropsHook.js index 199e59eb0bb..33c2b275d22 100644 --- a/packages/react-native/src/private/animated/createAnimatedPropsHook.js +++ b/packages/react-native/src/private/animated/createAnimatedPropsHook.js @@ -108,7 +108,7 @@ export default function createAnimatedPropsHook( (instance: TInstance) => { // NOTE: This may be called more often than necessary (e.g. when `props` // changes), but `setNativeView` already optimizes for that. - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] node.setNativeView(instance); // NOTE: When using the JS animation driver, this callback is called on @@ -188,7 +188,7 @@ export default function createAnimatedPropsHook( for (const [propName, propValue] of eventTuples) { propValue.__attach(target, propName); - // $FlowFixMe[incompatible-call] - the `addListenersToPropsValue` drills down the propValue. + // $FlowFixMe[incompatible-type] - the `addListenersToPropsValue` drills down the propValue. addListenersToPropsValue(propValue, animatedValueListeners); } diff --git a/packages/react-native/src/private/animated/createAnimatedPropsMemoHook.js b/packages/react-native/src/private/animated/createAnimatedPropsMemoHook.js index ad1f400f11e..4723a43d5ee 100644 --- a/packages/react-native/src/private/animated/createAnimatedPropsMemoHook.js +++ b/packages/react-native/src/private/animated/createAnimatedPropsMemoHook.js @@ -264,9 +264,9 @@ export function areCompositeKeysEqual( // We know style components are objects with non-mixed values. if ( !areCompositeKeyComponentsEqual( - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] prevComponent as $ReadOnlyCompositeKeyComponent, - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] nextComponent as $ReadOnlyCompositeKeyComponent, ) ) { @@ -289,9 +289,9 @@ export function areCompositeKeysEqual( } else { if ( !areCompositeKeyComponentsEqual( - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] prevComponent as $ReadOnlyCompositeKeyComponent, - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] nextComponent as $ReadOnlyCompositeKeyComponent, ) ) { diff --git a/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js b/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js index 48934fb3f32..a7b5516f77b 100644 --- a/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js +++ b/packages/react-native/src/private/components/virtualview/__tests__/VirtualView-itest.js @@ -346,7 +346,7 @@ export function dispatchModeChangeEvent( { mode: mode as number, targetRect, - // $FlowFixMe[incompatible-cast] - https://fburl.com/workplace/t8a3yvuo + // $FlowFixMe[incompatible-type] - https://fburl.com/workplace/t8a3yvuo thresholdRect, } as NativeModeChangeEvent, ); diff --git a/packages/react-native/src/private/devsupport/devmenu/elementinspector/Inspector.js b/packages/react-native/src/private/devsupport/devmenu/elementinspector/Inspector.js index 98ba78f6b94..5b421914ba5 100644 --- a/packages/react-native/src/private/devsupport/devmenu/elementinspector/Inspector.js +++ b/packages/react-native/src/private/devsupport/devmenu/elementinspector/Inspector.js @@ -82,7 +82,7 @@ function Inspector({ const {measure, props} = hierarchyItem.getInspectorData(findNodeHandle); measure((x, y, width, height, left, top) => { - // $FlowFixMe[incompatible-call] `props` from InspectorData are defined as dictionary, which is incompatible with ViewStyleProp + // $FlowFixMe[incompatible-type] `props` from InspectorData are defined as dictionary, which is incompatible with ViewStyleProp setInspectedElement({ frame: {left, top, width, height}, style: props.style, @@ -119,7 +119,7 @@ function Inspector({ ); setSelectionIndex(selectedIndex); setElementsHierarchy(hierarchy); - // $FlowFixMe[incompatible-call] `props` from InspectorData are defined as dictionary, which is incompatible with ViewStyleProp + // $FlowFixMe[incompatible-type] `props` from InspectorData are defined as dictionary, which is incompatible with ViewStyleProp setInspectedElement({ frame, style: props.style, diff --git a/packages/react-native/src/private/renderer/errorhandling/ErrorHandlers.js b/packages/react-native/src/private/renderer/errorhandling/ErrorHandlers.js index 18b807451d1..5c12bfe54b7 100644 --- a/packages/react-native/src/private/renderer/errorhandling/ErrorHandlers.js +++ b/packages/react-native/src/private/renderer/errorhandling/ErrorHandlers.js @@ -32,17 +32,17 @@ function getExtendedError( if (errorValue instanceof Error) { /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] error = (errorValue: ExtendedError); } else if (typeof errorValue === 'string') { /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] error = (new SyntheticError(errorValue): ExtendedError); } else { /* $FlowFixMe[class-object-subtyping] added when improving typing for * this parameters */ - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] error = (new SyntheticError('Unspecified error'): ExtendedError); } try { diff --git a/packages/react-native/src/private/webapis/dom/events/__tests__/Event-itest.js b/packages/react-native/src/private/webapis/dom/events/__tests__/Event-itest.js index 66228e0735f..21609b28a03 100644 --- a/packages/react-native/src/private/webapis/dom/events/__tests__/Event-itest.js +++ b/packages/react-native/src/private/webapis/dom/events/__tests__/Event-itest.js @@ -83,7 +83,7 @@ describe('Event', () => { it('should throw an error if type is not passed', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] return new Event(); }).toThrow( "Failed to construct 'Event': 1 argument required, but only 0 present.", @@ -186,13 +186,13 @@ describe('Event', () => { }); it('should coerce values to the right types', () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] const eventWithAllOptionsSet = new Event(undefined, { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] bubbles: 1, - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] cancelable: 'true', - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] composed: {}, }); diff --git a/packages/react-native/src/private/webapis/dom/events/__tests__/EventTarget-itest.js b/packages/react-native/src/private/webapis/dom/events/__tests__/EventTarget-itest.js index 7e71fe90693..4cc5699db46 100644 --- a/packages/react-native/src/private/webapis/dom/events/__tests__/EventTarget-itest.js +++ b/packages/react-native/src/private/webapis/dom/events/__tests__/EventTarget-itest.js @@ -35,7 +35,7 @@ type EventRecordingListener = JestMockFn<[Event], void> & { function createListener( implementation?: Event => void, ): EventRecordingListener { - // $FlowExpectedError[prop-missing] + // $FlowExpectedError[incompatible-type] const listener: EventRecordingListener = jest.fn((event: Event) => { listener.eventData = { callOrder: listenerCallOrder++, @@ -59,14 +59,14 @@ describe('EventTarget', () => { const eventTarget = new EventTarget(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener(); }).toThrow( "Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 0 present.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom'); }).toThrow( "Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 1 present.", @@ -81,41 +81,41 @@ describe('EventTarget', () => { const eventTarget = new EventTarget(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', 'foo'); }).toThrow( "Failed to execute 'addEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', Symbol('test')); }).toThrow( "Failed to execute 'addEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', true); }).toThrow( "Failed to execute 'addEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', 5); }).toThrow( "Failed to execute 'addEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', {}); }).not.toThrow(); // It should work even if the `handleEvent` property is not a function. expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', { handleEvent: 5, }); @@ -150,7 +150,7 @@ describe('EventTarget', () => { }).not.toThrow(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', () => {}, { signal: null, }); @@ -159,7 +159,7 @@ describe('EventTarget', () => { ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.addEventListener('custom', () => {}, { signal: {}, }); @@ -174,14 +174,14 @@ describe('EventTarget', () => { const eventTarget = new EventTarget(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener(); }).toThrow( "Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only 0 present.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener('eventName'); }).toThrow( "Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only 1 present.", @@ -196,41 +196,41 @@ describe('EventTarget', () => { const eventTarget = new EventTarget(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener('eventName', 'foo'); }).toThrow( "Failed to execute 'removeEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener('eventName', Symbol('test')); }).toThrow( "Failed to execute 'removeEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener('eventName', true); }).toThrow( "Failed to execute 'removeEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener('eventName', 5); }).toThrow( "Failed to execute 'removeEventListener' on 'EventTarget': parameter 2 is not of type 'Object'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener('eventName', {}); }).not.toThrow(); // It should work even if the `handleEvent` property is not a function. expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.removeEventListener('eventName', { handleEvent: 5, }); @@ -269,7 +269,7 @@ describe('EventTarget', () => { const eventTarget = new EventTarget(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.dispatchEvent(); }).toThrow( "Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.", @@ -284,14 +284,14 @@ describe('EventTarget', () => { const eventTarget = new EventTarget(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.dispatchEvent('foo'); }).toThrow( "Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.", ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] eventTarget.dispatchEvent(true); }).toThrow( "Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.", diff --git a/packages/react-native/src/private/webapis/dom/nodes/ReactNativeDocument.js b/packages/react-native/src/private/webapis/dom/nodes/ReactNativeDocument.js index eab5a051ac8..2c28e4a22f4 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/ReactNativeDocument.js +++ b/packages/react-native/src/private/webapis/dom/nodes/ReactNativeDocument.js @@ -74,7 +74,7 @@ export default class ReactNativeDocument extends ReadOnlyNode { return null; } - // $FlowExpectedError[incompatible-extend] This is defined as returning string in Node, but it's actually null in Document. + // $FlowExpectedError[incompatible-type] This is defined as returning string in Node, but it's actually null in Document. get textContent(): null { return null; } diff --git a/packages/react-native/src/private/webapis/dom/nodes/ReactNativeElement.js b/packages/react-native/src/private/webapis/dom/nodes/ReactNativeElement.js index abf3c738207..3da3ed4484a 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/ReactNativeElement.js +++ b/packages/react-native/src/private/webapis/dom/nodes/ReactNativeElement.js @@ -233,7 +233,7 @@ function replaceConstructorWithoutSuper( ReactNativeElement.prototype = ReactNativeElementClass.prototype; - // $FlowExpectedError[incompatible-return] + // $FlowExpectedError[incompatible-type] return ReactNativeElement; } diff --git a/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js b/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js index 85f7dee33b2..7639046f08e 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js +++ b/packages/react-native/src/private/webapis/dom/nodes/ReadOnlyElement.js @@ -220,7 +220,7 @@ export default class ReadOnlyElement extends ReadOnlyNode { } function getChildElements(node: ReadOnlyNode): $ReadOnlyArray { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] return getChildNodes(node).filter( childNode => childNode instanceof ReadOnlyElement, ); diff --git a/packages/react-native/src/private/webapis/dom/nodes/internals/NodeInternals.js b/packages/react-native/src/private/webapis/dom/nodes/internals/NodeInternals.js index d73a09ed8e4..bc805d3966e 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/internals/NodeInternals.js +++ b/packages/react-native/src/private/webapis/dom/nodes/internals/NodeInternals.js @@ -98,7 +98,7 @@ export function getPublicInstanceFromInstanceHandle( instanceHandle, ); - // $FlowExpectedError[incompatible-return] React defines public instances as "mixed" because it can't access the definition from React Native. + // $FlowExpectedError[incompatible-type] React defines public instances as "mixed" because it can't access the definition from React Native. return mixedPublicInstance; } @@ -119,14 +119,14 @@ export function getNativeNodeReference( ); } - // $FlowExpectedError[incompatible-return] + // $FlowExpectedError[incompatible-type] return getRendererProxy().getNodeFromInternalInstanceHandle(instanceHandle); } export function getNativeElementReference( node: ReadOnlyElement, ): ?NativeElementReference { - // $FlowExpectedError[incompatible-cast] We know ReadOnlyElement instances provide InternalInstanceHandle + // $FlowExpectedError[incompatible-type] We know ReadOnlyElement instances provide InternalInstanceHandle const instanceHandle = getInstanceHandle(node) as InternalInstanceHandle; if (isReactNativeDocumentElementInstanceHandle(instanceHandle)) { @@ -135,16 +135,16 @@ export function getNativeElementReference( ); } - // $FlowExpectedError[incompatible-return] + // $FlowExpectedError[incompatible-type] return getRendererProxy().getNodeFromInternalInstanceHandle(instanceHandle); } export function getNativeTextReference( node: ReadOnlyCharacterData, ): ?NativeTextReference { - // $FlowExpectedError[incompatible-cast] We know ReadOnlyText instances provide InternalInstanceHandle + // $FlowExpectedError[incompatible-type] We know ReadOnlyText instances provide InternalInstanceHandle const instanceHandle = getInstanceHandle(node) as InternalInstanceHandle; - // $FlowExpectedError[incompatible-return] + // $FlowExpectedError[incompatible-type] return getRendererProxy().getNodeFromInternalInstanceHandle(instanceHandle); } diff --git a/packages/react-native/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js b/packages/react-native/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js index 5b291b936d1..04764fde2ce 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js +++ b/packages/react-native/src/private/webapis/dom/nodes/internals/ReactNativeDocumentInstanceHandle.js @@ -31,7 +31,7 @@ export function getNativeNodeReferenceFromReactNativeDocumentInstanceHandle( export function getPublicInstanceFromReactNativeDocumentInstanceHandle( instanceHandle: ReactNativeDocumentInstanceHandle, ): ?ReactNativeDocument { - // $FlowExpectedError[incompatible-return] React defines public instances as "mixed" because it can't access the definition from React Native. + // $FlowExpectedError[incompatible-type] React defines public instances as "mixed" because it can't access the definition from React Native. return RendererProxy.getPublicInstanceFromRootTag(Number(instanceHandle)); } diff --git a/packages/react-native/src/private/webapis/dom/nodes/specs/NativeDOM.js b/packages/react-native/src/private/webapis/dom/nodes/specs/NativeDOM.js index 4d05d4c4eee..588392d06ea 100644 --- a/packages/react-native/src/private/webapis/dom/nodes/specs/NativeDOM.js +++ b/packages/react-native/src/private/webapis/dom/nodes/specs/NativeDOM.js @@ -459,14 +459,14 @@ const NativeDOM: RefinedSpec = { }, getChildNodes(nativeNodeReference) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getChildNodes( nativeNodeReference, ): $ReadOnlyArray); }, getElementById(rootTag, id) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM?.getElementById)( rootTag, id, @@ -474,7 +474,7 @@ const NativeDOM: RefinedSpec = { }, getParentNode(nativeNodeReference) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getParentNode( nativeNodeReference, ): ?InstanceHandle); @@ -489,7 +489,7 @@ const NativeDOM: RefinedSpec = { */ getBorderWidth(nativeNodeReference) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getBorderWidth( nativeNodeReference, ): $ReadOnly< @@ -503,7 +503,7 @@ const NativeDOM: RefinedSpec = { }, getBoundingClientRect(nativeNodeReference, includeTransform: boolean) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getBoundingClientRect( nativeNodeReference, includeTransform, @@ -518,21 +518,21 @@ const NativeDOM: RefinedSpec = { }, getInnerSize(nativeNodeReference) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getInnerSize( nativeNodeReference, ): $ReadOnly<[/* width: */ number, /* height: */ number]>); }, getScrollPosition(nativeNodeReference) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getScrollPosition( nativeNodeReference, ): $ReadOnly<[/* scrollLeft: */ number, /* scrollTop: */ number]>); }, getScrollSize(nativeNodeReference) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getScrollSize( nativeNodeReference, ): $ReadOnly<[/* scrollWidth: */ number, /* scrollHeight: */ number]>); @@ -572,7 +572,7 @@ const NativeDOM: RefinedSpec = { */ getOffset(nativeNodeReference) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM).getOffset(nativeNodeReference): $ReadOnly< [ /* offsetParent: */ ?InstanceHandle, @@ -587,9 +587,9 @@ const NativeDOM: RefinedSpec = { */ linkRootNode(rootTag, instanceHandle) { - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] return (nullthrows(RawNativeDOM?.linkRootNode)( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] rootTag, instanceHandle, ): ?NativeElementReference); diff --git a/packages/react-native/src/private/webapis/dom/oldstylecollections/HTMLCollection.js b/packages/react-native/src/private/webapis/dom/oldstylecollections/HTMLCollection.js index 28cadb29992..aa1996b340a 100644 --- a/packages/react-native/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +++ b/packages/react-native/src/private/webapis/dom/oldstylecollections/HTMLCollection.js @@ -18,7 +18,7 @@ import {setPlatformObject} from '../../webidl/PlatformObjects'; // IMPORTANT: The type definition for this module is defined in `HTMLCollection.js.flow` // because Flow only supports indexers in classes in declaration files. -// $FlowFixMe[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. +// $FlowFixMe[incompatible-type] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. export default class HTMLCollection implements Iterable, ArrayLike { #length: number; diff --git a/packages/react-native/src/private/webapis/dom/oldstylecollections/NodeList.js b/packages/react-native/src/private/webapis/dom/oldstylecollections/NodeList.js index 4c48f43f3ab..9e2cdae2483 100644 --- a/packages/react-native/src/private/webapis/dom/oldstylecollections/NodeList.js +++ b/packages/react-native/src/private/webapis/dom/oldstylecollections/NodeList.js @@ -22,7 +22,7 @@ import {setPlatformObject} from '../../webidl/PlatformObjects'; // IMPORTANT: The Flow type definition for this module is defined in `NodeList.js.flow` // because Flow only supports indexers in classes in declaration files. -// $FlowFixMe[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. +// $FlowFixMe[incompatible-type] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. export default class NodeList implements Iterable, ArrayLike { #length: number; diff --git a/packages/react-native/src/private/webapis/errors/__tests__/DOMException-itest.js b/packages/react-native/src/private/webapis/errors/__tests__/DOMException-itest.js index c4eab426433..d5e63ee61ca 100644 --- a/packages/react-native/src/private/webapis/errors/__tests__/DOMException-itest.js +++ b/packages/react-native/src/private/webapis/errors/__tests__/DOMException-itest.js @@ -77,9 +77,9 @@ describe('DOMException', () => { it('normalizes the name correctly', () => { expect(new DOMException(undefined, undefined).name).toBe('Error'); expect(new DOMException(undefined, '').name).toBe(''); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(new DOMException(undefined, null).name).toBe('null'); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(new DOMException(undefined, {}).name).toBe('[object Object]'); }); diff --git a/packages/react-native/src/private/webapis/geometry/DOMRectList.js b/packages/react-native/src/private/webapis/geometry/DOMRectList.js index 2260a9241a9..5da2966747a 100644 --- a/packages/react-native/src/private/webapis/geometry/DOMRectList.js +++ b/packages/react-native/src/private/webapis/geometry/DOMRectList.js @@ -19,7 +19,7 @@ import {setPlatformObject} from '../webidl/PlatformObjects'; // IMPORTANT: The Flow type definition for this module is defined in `DOMRectList.js.flow` // because Flow only supports indexers in classes in declaration files. -// $FlowFixMe[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. +// $FlowFixMe[incompatible-type] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface. export default class DOMRectList implements Iterable { #length: number; diff --git a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js index 0341ff5c5d0..405cca9490c 100644 --- a/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js +++ b/packages/react-native/src/private/webapis/intersectionobserver/__tests__/IntersectionObserver-itest.js @@ -72,7 +72,7 @@ describe('IntersectionObserver', () => { describe('constructor(callback, {root, rootMargin, threshold, rnRootThreshold})', () => { it('should throw if `callback` is not provided', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] return new IntersectionObserver(); }).toThrow( "Failed to construct 'IntersectionObserver': 1 argument required, but only 0 present.", @@ -81,7 +81,7 @@ describe('IntersectionObserver', () => { it('should throw if `callback` is not a function', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] return new IntersectionObserver('not a function!'); }).toThrow( "Failed to construct 'IntersectionObserver': parameter 1 is not of type 'Function'.", @@ -113,7 +113,7 @@ describe('IntersectionObserver', () => { it('should throw if `threshold` contains a value that cannot be casted to a finite number', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] return new IntersectionObserver(() => {}, {threshold: ['test']}); }).toThrow( "Failed to read the 'threshold' property from 'IntersectionObserverInit': The provided double value is non-finite.", @@ -122,7 +122,7 @@ describe('IntersectionObserver', () => { it('should throw if `root` is not a `ReactNativeElement`', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] observer = new IntersectionObserver(() => {}, {root: 'something'}); }).toThrow( "Failed to construct 'IntersectionObserver': Failed to read the 'root' property from 'IntersectionObserverInit': The provided value is not of type '(null or ReactNativeElement)", @@ -180,22 +180,22 @@ describe('IntersectionObserver', () => { // Casts to number expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {threshold: [true]}).thresholds, ).toEqual([1]); expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {threshold: [false]}).thresholds, ).toEqual([0]); expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {threshold: ['']}).thresholds, ).toEqual([0]); }); it('should not throw if rnRootThreshold is null or undefined', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] return new IntersectionObserver(() => {}, {rnRootThreshold: null}); }).not.toThrow(); @@ -218,7 +218,7 @@ describe('IntersectionObserver', () => { expect(() => { return new IntersectionObserver(() => {}, { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] rnRootThreshold: 'invalid', }); }).toThrow( @@ -235,7 +235,7 @@ describe('IntersectionObserver', () => { new IntersectionObserver(() => {}, {threshold: 1}).rnRootThresholds, ).toBeNull(); expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {rnRootThreshold: null}) .rnRootThresholds, ).toBeNull(); @@ -251,7 +251,7 @@ describe('IntersectionObserver', () => { ).toBeNull(); expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {rnRootThreshold: [null]}) .rnRootThresholds, ).toBeNull(); @@ -286,17 +286,17 @@ describe('IntersectionObserver', () => { // Casts to number expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {rnRootThreshold: [true]}) .rnRootThresholds, ).toEqual([1]); expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {rnRootThreshold: [false]}) .rnRootThresholds, ).toEqual([0]); expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {rnRootThreshold: ['']}) .rnRootThresholds, ).toEqual([0]); @@ -314,7 +314,7 @@ describe('IntersectionObserver', () => { it('should default thresholds to [0] if rnRootThreshold is invalidly set', () => { expect( - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] new IntersectionObserver(() => {}, {rnRootThreshold: null}).thresholds, ).toEqual([0]); @@ -328,7 +328,7 @@ describe('IntersectionObserver', () => { it('should throw if `target` is not a `ReactNativeElement`', () => { observer = new IntersectionObserver(() => {}); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] observer.observe('something'); }).toThrow( "Failed to execute 'observe' on 'IntersectionObserver': parameter 1 is not of type 'ReactNativeElement'.", @@ -2005,7 +2005,7 @@ describe('IntersectionObserver', () => { it('should throw if `target` is not a `ReactNativeElement`', () => { observer = new IntersectionObserver(() => {}); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] observer.unobserve('something'); }).toThrow( "Failed to execute 'unobserve' on 'IntersectionObserver': parameter 1 is not of type 'ReactNativeElement'.", diff --git a/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js b/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js index d06779ed222..7609f41b22b 100644 --- a/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js +++ b/packages/react-native/src/private/webapis/mutationobserver/__tests__/MutationObserver-itest.js @@ -45,7 +45,7 @@ describe('MutationObserver', () => { describe('constructor(callback)', () => { it('should throw if `callback` is not provided', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] return new MutationObserver(); }).toThrow( "Failed to construct 'MutationObserver': 1 argument required, but only 0 present.", @@ -54,7 +54,7 @@ describe('MutationObserver', () => { it('should throw if `callback` is not a function', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] return new MutationObserver('not a function!'); }).toThrow( "Failed to construct 'MutationObserver': parameter 1 is not of type 'Function'.", @@ -66,7 +66,7 @@ describe('MutationObserver', () => { it('should throw if `target` is not a `ReactNativeElement`', () => { const observer = new MutationObserver(() => {}); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] observer.observe('something'); }).toThrow( "Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'ReactNativeElement'.", @@ -92,7 +92,7 @@ describe('MutationObserver', () => { expect(() => { const observer = new MutationObserver(() => {}); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] observer.observe(node, {childList: false}); }).toThrow( "Failed to execute 'observe' on 'MutationObserver': The options object must set 'childList' to true.", @@ -105,7 +105,7 @@ describe('MutationObserver', () => { expect(() => { const observer = new MutationObserver(() => {}); - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] observer.observe(node, {childList: 1}); }).not.toThrow(); }); diff --git a/packages/react-native/src/private/webapis/mutationobserver/internals/MutationObserverManager.js b/packages/react-native/src/private/webapis/mutationobserver/internals/MutationObserverManager.js index b74f420f020..a929b5d07c6 100644 --- a/packages/react-native/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +++ b/packages/react-native/src/private/webapis/mutationobserver/internals/MutationObserverManager.js @@ -111,7 +111,7 @@ export function observe({ // the public instance immediately when mutations occur. Otherwise React // could dereference it in the instance handle and we wouldn't be able to // access it. - // $FlowExpectedError[incompatible-call] This is typed as (mixed) => mixed in the native module because the codegen doesn't support the actual types. + // $FlowExpectedError[incompatible-type] This is typed as (mixed) => mixed in the native module because the codegen doesn't support the actual types. getPublicInstanceFromInternalInstanceHandle, ); isConnected = true; diff --git a/packages/react-native/src/private/webapis/performance/EventTiming.js b/packages/react-native/src/private/webapis/performance/EventTiming.js index 8f96f8d6ba8..3f99141e223 100644 --- a/packages/react-native/src/private/webapis/performance/EventTiming.js +++ b/packages/react-native/src/private/webapis/performance/EventTiming.js @@ -93,7 +93,7 @@ function getCachedEventCounts(): Map { ); cachedEventCounts = eventCounts; - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] global.queueMicrotask(() => { // To be consistent with the calls to the API from the same task, // but also not to refetch the data from native too often, diff --git a/packages/react-native/src/private/webapis/performance/__tests__/UserTiming-itest.js b/packages/react-native/src/private/webapis/performance/__tests__/UserTiming-itest.js index 748a8bacb59..0bc20e7c012 100644 --- a/packages/react-native/src/private/webapis/performance/__tests__/UserTiming-itest.js +++ b/packages/react-native/src/private/webapis/performance/__tests__/UserTiming-itest.js @@ -95,7 +95,7 @@ describe('User Timing', () => { it('throws if no name is provided', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] performance.mark(); }).toThrow( `Failed to execute 'mark' on 'Performance': 1 argument required, but only 0 present.`, @@ -103,7 +103,7 @@ describe('User Timing', () => { }); it('casts mark name to a string', () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] const mark = performance.mark(10); expect(mark.name).toBe('10'); @@ -111,14 +111,14 @@ describe('User Timing', () => { it('casts startTime to a number', () => { const mark = performance.mark('some-mark', { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] startTime: '10', }); expect(mark.startTime).toBe(10); const mark2 = performance.mark('some-mark', { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] startTime: null, }); @@ -133,7 +133,7 @@ describe('User Timing', () => { ); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] performance.mark('some-mark', {startTime: {}}); }).toThrow( `Failed to execute 'mark' on 'Performance': Failed to read the 'startTime' property from 'PerformanceMarkOptions': The provided double value is non-finite.`, @@ -494,7 +494,7 @@ describe('User Timing', () => { }); it('casts measure name to a string', () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] const measure = performance.measure(10); expect(measure.name).toBe('10'); @@ -502,7 +502,7 @@ describe('User Timing', () => { it('throws if no name is provided', () => { expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] performance.measure(); }).toThrow( `Failed to execute 'measure' on 'Performance': 1 argument required, but only 0 present.`, diff --git a/packages/react-native/src/private/webapis/structuredClone/structuredClone.js b/packages/react-native/src/private/webapis/structuredClone/structuredClone.js index 60e411dbbdf..5cd200f72ca 100644 --- a/packages/react-native/src/private/webapis/structuredClone/structuredClone.js +++ b/packages/react-native/src/private/webapis/structuredClone/structuredClone.js @@ -61,7 +61,7 @@ function structuredCloneInternal(value: T): T { // Handles circular references. if (memory.has(value)) { - // $FlowExpectedError[incompatible-return] we know memory.get(value) is T + // $FlowExpectedError[incompatible-type] we know memory.get(value) is T return memory.get(value); } @@ -74,7 +74,7 @@ function structuredCloneInternal(value: T): T { result[key] = structuredCloneInternal(value[key]); } - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } @@ -89,7 +89,7 @@ function structuredCloneInternal(value: T): T { result[key] = structuredCloneInternal(value[key]); } - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } @@ -99,7 +99,7 @@ function structuredCloneInternal(value: T): T { if (value instanceof Cls) { const result = new Cls(value); memory.set(value, result); - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } } @@ -115,7 +115,7 @@ function structuredCloneInternal(value: T): T { ); } - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } @@ -127,7 +127,7 @@ function structuredCloneInternal(value: T): T { result.add(structuredCloneInternal(innerValue)); } - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } @@ -135,7 +135,7 @@ function structuredCloneInternal(value: T): T { const result = new RegExp(value.source, value.flags); memory.set(value, result); - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } @@ -162,7 +162,7 @@ function structuredCloneInternal(value: T): T { result.stack = value.stack; - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } @@ -185,7 +185,7 @@ function structuredCloneInternal(value: T): T { result[key] = structuredCloneInternal(value[key]); } - // $FlowExpectedError[incompatible-return] we know result is T + // $FlowExpectedError[incompatible-type] we know result is T return result; } diff --git a/packages/rn-tester/IntegrationTests/IntegrationTestsApp.js b/packages/rn-tester/IntegrationTests/IntegrationTestsApp.js index d278a1b6d89..c9f736ab38d 100644 --- a/packages/rn-tester/IntegrationTests/IntegrationTestsApp.js +++ b/packages/rn-tester/IntegrationTests/IntegrationTestsApp.js @@ -36,7 +36,7 @@ const TESTS = [ TESTS.forEach(test => AppRegistry.registerComponent( test.displayName || test.name || '', - /* $FlowFixMe[incompatible-call] (>=0.54.0 site=react_native_fb,react_native_ + /* $FlowFixMe[incompatible-type] (>=0.54.0 site=react_native_fb,react_native_ * oss) This comment suppresses an error found when Flow v0.54 was deployed. * To see the error delete this comment and run Flow. */ () => test, diff --git a/packages/rn-tester/IntegrationTests/LayoutEventsTest.js b/packages/rn-tester/IntegrationTests/LayoutEventsTest.js index 1d414680cbd..ed6796bb355 100644 --- a/packages/rn-tester/IntegrationTests/LayoutEventsTest.js +++ b/packages/rn-tester/IntegrationTests/LayoutEventsTest.js @@ -119,19 +119,19 @@ class LayoutEventsTest extends React.Component { } onViewLayout: (e: LayoutChangeEvent) => void = (e: LayoutChangeEvent) => { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] debug('received view layout event\n', e.nativeEvent); this.setState({viewLayout: e.nativeEvent.layout}, this.checkLayout); }; onTextLayout: (e: LayoutChangeEvent) => void = (e: LayoutChangeEvent) => { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] debug('received text layout event\n', e.nativeEvent); this.setState({textLayout: e.nativeEvent.layout}, this.checkLayout); }; onImageLayout: (e: LayoutChangeEvent) => void = (e: LayoutChangeEvent) => { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] debug('received image layout event\n', e.nativeEvent); this.setState({imageLayout: e.nativeEvent.layout}, this.checkLayout); }; diff --git a/packages/rn-tester/NativeComponentExample/js/MyNativeView.js b/packages/rn-tester/NativeComponentExample/js/MyNativeView.js index 2fed427bb6c..198ade0266f 100644 --- a/packages/rn-tester/NativeComponentExample/js/MyNativeView.js +++ b/packages/rn-tester/NativeComponentExample/js/MyNativeView.js @@ -183,7 +183,7 @@ export default function MyNativeView(props: {}): React.Node { currentBGColor + 1 >= colors.length ? 0 : currentBGColor + 1; let newColor = colors[nextBGColor]; RNTMyNativeViewCommands.callNativeMethodToChangeBackgroundColor( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] ref.current, newColor, ); @@ -215,7 +215,7 @@ export default function MyNativeView(props: {}): React.Node { colors[(randomColorId + 1) % 5], ]; RNTMyNativeViewCommands.callNativeMethodToAddOverlays( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] ref.current, overlayColors, ); @@ -226,7 +226,7 @@ export default function MyNativeView(props: {}): React.Node { title="Remove Overlays" onPress={() => { RNTMyNativeViewCommands.callNativeMethodToRemoveOverlays( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] ref.current, ); callNativeMethodToRemoveOverlays(legacyRef.current); @@ -287,7 +287,7 @@ export default function MyNativeView(props: {}): React.Node { title="Fire Legacy Style Event" onPress={() => { RNTMyNativeViewCommands.fireLagacyStyleEvent( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] ref.current, ); }} diff --git a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js index 696de6e68d3..71906a96d54 100644 --- a/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js +++ b/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js @@ -1330,7 +1330,7 @@ function SetAccessibilityFocusExample(props: {}): React.Node { return ( - {/* $FlowFixMe[prop-missing] */} + {/* $FlowFixMe[incompatible-type */} SetAccessibilityFocus on native element. This should get focus after clicking the button! diff --git a/packages/rn-tester/js/examples/Alert/AlertExample.js b/packages/rn-tester/js/examples/Alert/AlertExample.js index 3df0a7156ee..706982325a0 100644 --- a/packages/rn-tester/js/examples/Alert/AlertExample.js +++ b/packages/rn-tester/js/examples/Alert/AlertExample.js @@ -261,7 +261,7 @@ const PromptOptions = () => { Alert.prompt('Type a value', null, customButtons)}> @@ -308,7 +308,7 @@ const PromptOptions = () => { Alert.prompt( 'Type a value', null, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ customButtons, 'login-password', @@ -457,7 +457,7 @@ export default ({ documentationURL: 'https://reactnative.dev/docs/alert', description: 'Alerts display a concise and informative message and prompt the user to make a decision.', - /* $FlowFixMe[incompatible-cast] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ examples, }: RNTesterModule); diff --git a/packages/rn-tester/js/examples/Animated/TransformStylesExample.js b/packages/rn-tester/js/examples/Animated/TransformStylesExample.js index 0187e6b024c..df5f7b63ffb 100644 --- a/packages/rn-tester/js/examples/Animated/TransformStylesExample.js +++ b/packages/rn-tester/js/examples/Animated/TransformStylesExample.js @@ -126,7 +126,7 @@ function AnimatedTransformStyleExample(): React.Node { properties[property].selected, )} diff --git a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js index f5447314416..a980a86a374 100644 --- a/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js +++ b/packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js @@ -112,7 +112,7 @@ class Circle extends React.Component { }, onResponderRelease: () => { if (!this.state.panResponder) { - /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) + /* $FlowFixMe[incompatible-type] (>=0.63.0 site=react_native_fb) * This comment suppresses an error found when Flow v0.63 was * deployed. To see the error delete this comment and run Flow. */ clearTimeout(this.longTimer); diff --git a/packages/rn-tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js b/packages/rn-tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js index 483f6c64f80..1628c6bef70 100644 --- a/packages/rn-tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js +++ b/packages/rn-tester/js/examples/Experimental/Compatibility/ManyPointersPropertiesExample.js @@ -48,7 +48,7 @@ function ManyPointersPropertiesExample(): React.Node { const onPointerMove = (event: PointerEvent) => { const pointerId = event.nativeEvent.pointerId; // $FlowFixMe[invalid-computed-prop] - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] setData({...data, [pointerId]: event.nativeEvent}); }; diff --git a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js index 0418a9376e8..c6a1497f712 100644 --- a/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js +++ b/packages/rn-tester/js/examples/Experimental/PlatformTest/RNTesterPlatformTestEventRecorder.js @@ -112,7 +112,7 @@ export default class RNTesterPlatformTestEventRecorder { targetName, (event, eventType) => callback?.(event, eventType, targetName), ); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] const eventListenerProps = this.relevantEvents.reduce( (acc: ViewProps, eventName) => { const eventPropName = diff --git a/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js b/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js index 3d46dd5dc97..41c1cbc1043 100644 --- a/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js +++ b/packages/rn-tester/js/examples/FlatList/BaseFlatListExample.js @@ -97,7 +97,7 @@ const BaseFlatListExample: component( data={DATA} keyExtractor={(item, index) => item + index} style={styles.list} - // $FlowFixMe[incompatible-type-arg] + // $FlowFixMe[incompatible-type] renderItem={Item} /> diff --git a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js index f4354540e36..508a71dc82f 100644 --- a/packages/rn-tester/js/examples/FlatList/FlatList-basic.js +++ b/packages/rn-tester/js/examples/FlatList/FlatList-basic.js @@ -129,7 +129,7 @@ class FlatListExample extends React.PureComponent { } _setBooleanValue: string => boolean => void = key => value => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] this.setState({[key]: value}); _setIsRTL: boolean => void = value => { diff --git a/packages/rn-tester/js/examples/Pressable/PressableExample.js b/packages/rn-tester/js/examples/Pressable/PressableExample.js index b385cf275f3..dd1c2b0b129 100644 --- a/packages/rn-tester/js/examples/Pressable/PressableExample.js +++ b/packages/rn-tester/js/examples/Pressable/PressableExample.js @@ -577,7 +577,7 @@ module.exports = ({ category: 'UI', description: 'Component for making views pressable.', displayName: 'Pressable', - /* $FlowFixMe[incompatible-cast] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ examples, }: RNTesterModule); diff --git a/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js b/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js index 019afd0cfcd..5246a9f26be 100644 --- a/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js +++ b/packages/rn-tester/js/examples/SectionList/SectionList-scrollable.js @@ -194,7 +194,7 @@ export function SectionList_scrollable(Props: {...}): React.MixedElement { let startIndex = 0; const endIndex = filteredData.length - 1; for (let ii = 10; ii <= endIndex + 10; ii += 10) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] filteredSectionData.push({ key: `${filteredData[startIndex].key} - ${ filteredData[Math.min(ii - 1, endIndex)].key diff --git a/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js b/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js index 17309258ec3..59547b36f03 100644 --- a/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js +++ b/packages/rn-tester/js/examples/Snapshot/SnapshotViewIOS.ios.js @@ -45,7 +45,7 @@ class SnapshotViewIOS extends React.Component { const testIdentifier = this.props.testIdentifier || 'test'; const onSnapshotReady = this.props.onSnapshotReady || this.onDefaultAction; return ( - // $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors + // $FlowFixMe[incompatible-type] - Typing ReactNativeComponent revealed errors { constructor(props: void | {...}) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] super(props); this.state = {text: 'Placeholder Text'}; } @@ -85,7 +85,7 @@ class TextInputAccessoryViewChangeKeyboardExample extends React.Component< {keyboardType: string, text: string}, > { constructor(props: void | {...}) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] super(props); this.state = {text: '', keyboardType: 'default'}; } @@ -130,7 +130,7 @@ class TextInputAccessoryViewDefaultDoneButtonExample extends React.Component< {text: string}, > { constructor(props: void | $ReadOnly<{keyboardType: KeyboardTypeOptions}>) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] super(props); this.state = {text: ''}; } diff --git a/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js b/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js index 0bcb0a3024c..fb7e1f398e6 100644 --- a/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js +++ b/packages/rn-tester/js/examples/TurboModule/NativeCxxModuleExampleExample.js @@ -172,7 +172,9 @@ class NativeCxxModuleExampleExample extends React.Component<{}, State> { DeviceEventEmitter.addListener(CUSTOM_EVENT_TYPE, (...args) => { this._setResult( 'emitDeviceEvent', - `${CUSTOM_EVENT_TYPE}(${args.map(s => (typeof s === 'object' ? JSON.stringify(s) : s)).join(', ')})`, + `${CUSTOM_EVENT_TYPE}(${args + .map(s => (typeof s === 'object' ? JSON.stringify(s) : s)) + .join(', ')})`, ); }); NativeCxxModuleExample?.emitCustomDeviceEvent(CUSTOM_EVENT_TYPE); @@ -328,7 +330,7 @@ class NativeCxxModuleExampleExample extends React.Component<{}, State> { item} renderItem={({item}: {item: Examples, ...}) => ( @@ -348,7 +350,7 @@ class NativeCxxModuleExampleExample extends React.Component<{}, State> { item} renderItem={({item}: {item: ErrorExamples, ...}) => ( diff --git a/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js b/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js index f19485edcf1..3a57d12ce6c 100644 --- a/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js +++ b/packages/rn-tester/js/examples/TurboModule/SampleTurboModuleExample.js @@ -250,7 +250,7 @@ class SampleTurboModuleExample extends React.Component<{}, State> { style={[styles.column, styles.button]} onPress={() => Object.keys(this._tests).forEach(item => - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] this._setResult(item, this._tests[item]()), ) }> @@ -267,7 +267,7 @@ class SampleTurboModuleExample extends React.Component<{}, State> { item} renderItem={({item}: {item: Examples, ...}) => ( @@ -287,7 +287,7 @@ class SampleTurboModuleExample extends React.Component<{}, State> { item} renderItem={({item}: {item: ErrorExamples, ...}) => ( diff --git a/packages/rn-tester/js/examples/WebSocket/websocket_test_server.js b/packages/rn-tester/js/examples/WebSocket/websocket_test_server.js index 727ac0eba4e..ce985636cb7 100755 --- a/packages/rn-tester/js/examples/WebSocket/websocket_test_server.js +++ b/packages/rn-tester/js/examples/WebSocket/websocket_test_server.js @@ -31,7 +31,7 @@ server.on('connection', ws => { ws.on('message', message => { console.log('Received message:', message); if (respondWithBinary) { - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] message = Buffer.from(message); } if (message === 'getImage') { diff --git a/packages/rn-tester/js/utils/RNTesterNavigationReducer.js b/packages/rn-tester/js/utils/RNTesterNavigationReducer.js index 3a3fd36dd31..a952455b82f 100644 --- a/packages/rn-tester/js/utils/RNTesterNavigationReducer.js +++ b/packages/rn-tester/js/utils/RNTesterNavigationReducer.js @@ -45,7 +45,7 @@ const getUpdatedRecentlyUsed = ({ if (existingKeys.includes(key)) { existingKeys = existingKeys.filter(k => k !== key); } - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] existingKeys.unshift(key); updatedRecentlyUsed[exampleType] = existingKeys.slice(0, 5); diff --git a/packages/virtualized-lists/Lists/ViewabilityHelper.js b/packages/virtualized-lists/Lists/ViewabilityHelper.js index b49455794d5..4c3da7e3c7c 100644 --- a/packages/virtualized-lists/Lists/ViewabilityHelper.js +++ b/packages/virtualized-lists/Lists/ViewabilityHelper.js @@ -96,7 +96,7 @@ class ViewabilityHelper { * Cleanup, e.g. on unmount. Clears any pending timers. */ dispose() { - /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + /* $FlowFixMe[incompatible-type] (>=0.63.0 site=react_native_fb) This * comment suppresses an error found when Flow v0.63 was deployed. To see * the error delete this comment and run Flow. */ this._timers.forEach(clearTimeout); @@ -227,7 +227,7 @@ class ViewabilityHelper { this._viewableIndices = viewableIndices; if (this._config.minimumViewTime) { const handle: TimeoutID = setTimeout(() => { - /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + /* $FlowFixMe[incompatible-type] (>=0.63.0 site=react_native_fb) This * comment suppresses an error found when Flow v0.63 was deployed. To * see the error delete this comment and run Flow. */ this._timers.delete(handle); @@ -238,7 +238,7 @@ class ViewabilityHelper { createViewToken, ); }, this._config.minimumViewTime); - /* $FlowFixMe[incompatible-call] (>=0.63.0 site=react_native_fb) This + /* $FlowFixMe[incompatible-type] (>=0.63.0 site=react_native_fb) This * comment suppresses an error found when Flow v0.63 was deployed. To see * the error delete this comment and run Flow. */ this._timers.add(handle); diff --git a/packages/virtualized-lists/Lists/VirtualizedList.js b/packages/virtualized-lists/Lists/VirtualizedList.js index e060617a2be..66e6fd5e1da 100644 --- a/packages/virtualized-lists/Lists/VirtualizedList.js +++ b/packages/virtualized-lists/Lists/VirtualizedList.js @@ -168,9 +168,7 @@ class VirtualizedList extends StateSafePureComponent< ); invariant( getItemCount(data) >= 1, - `scrollToIndex out of range: item length ${getItemCount( - data, - )} but minimum is 1`, + `scrollToIndex out of range: item length ${getItemCount(data)} but minimum is 1`, ); invariant( index < getItemCount(data), @@ -265,7 +263,7 @@ class VirtualizedList extends StateSafePureComponent< return; } - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] scrollRef.scrollTo({ animated, ...this._scrollToParamsFromOffset(offset), @@ -944,7 +942,7 @@ class VirtualizedList extends StateSafePureComponent< ListHeaderComponent ) : ( // $FlowFixMe[not-a-component] - // $FlowFixMe[incompatible-type-arg] + // $FlowFixMe[incompatible-type] ); cells.push( @@ -979,7 +977,7 @@ class VirtualizedList extends StateSafePureComponent< ListEmptyComponent ) : ( // $FlowFixMe[not-a-component] - // $FlowFixMe[incompatible-type-arg] + // $FlowFixMe[incompatible-type] )): any); cells.push( @@ -1067,7 +1065,7 @@ class VirtualizedList extends StateSafePureComponent< ListFooterComponent ) : ( // $FlowFixMe[not-a-component] - // $FlowFixMe[incompatible-type-arg] + // $FlowFixMe[incompatible-type] ); cells.push( @@ -1140,7 +1138,7 @@ class VirtualizedList extends StateSafePureComponent< this.props.renderScrollComponent || this._defaultRenderScrollComponent )( - // $FlowExpectedError[prop-missing] scrollProps is a superset of ScrollViewProps + // $FlowExpectedError[incompatible-type] scrollProps is a superset of ScrollViewProps scrollProps, ) as ExactReactElement_DEPRECATED, { diff --git a/packages/virtualized-lists/Lists/VirtualizedSectionList.js b/packages/virtualized-lists/Lists/VirtualizedSectionList.js index 9f590cc2491..33cec7e19ed 100644 --- a/packages/virtualized-lists/Lists/VirtualizedSectionList.js +++ b/packages/virtualized-lists/Lists/VirtualizedSectionList.js @@ -243,7 +243,7 @@ class VirtualizedSectionList< // We intend for there to be overflow by one on both ends of the list. // This will be for headers and footers. When returning a header or footer // item the section itself is the item. - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] return section; } else if (itemIdx < itemCount) { // If we are in the bounds of the list's data then return the item. @@ -553,7 +553,7 @@ function ItemWithSeparator( useEffect(() => { setSelfHighlightCallback(cellKey, setSeparatorHighlighted); - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] setSelfUpdatePropsCallback(cellKey, setSeparatorProps); return () => { diff --git a/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js b/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js index 4af77b7af4d..89cee09b636 100644 --- a/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js +++ b/packages/virtualized-lists/Lists/__tests__/FillRateHelper-test.js @@ -70,7 +70,7 @@ describe('computeBlankness', function () { }); it('computes correct blankness of viewport', function () { - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. const helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { header: {y: 0, height: 0, isMounted: true}, @@ -90,7 +90,7 @@ describe('computeBlankness', function () { }); it('skips frames that are not in layout', function () { - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. const helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { header: {y: 0, height: 0, isMounted: false}, @@ -105,7 +105,7 @@ describe('computeBlankness', function () { }); it('sampling rate can disable', function () { - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. let helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { header: {y: 0, height: 0, isMounted: true}, @@ -117,7 +117,7 @@ describe('computeBlankness', function () { FillRateHelper.setSampleRate(0); - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper = new FillRateHelper({getCellMetrics}); blankness = computeResult({helper}); expect(blankness).toBe(0); @@ -129,7 +129,7 @@ describe('computeBlankness', function () { FillRateHelper.addListener(listener), ); subscriptions[1].remove(); - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. const helper = new FillRateHelper({getCellMetrics}); rowFramesGlobal = { header: {y: 0, height: 0, isMounted: true}, diff --git a/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js b/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js index 23fecc367b1..e8690b49402 100644 --- a/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js +++ b/packages/virtualized-lists/Lists/__tests__/ViewabilityHelper-test.js @@ -47,7 +47,7 @@ describe('computeViewableItems', function () { }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 0, 200, {getCellMetrics}), ).toEqual([0, 1, 2, 3]); }); @@ -64,7 +64,7 @@ describe('computeViewableItems', function () { }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 0, 200, {getCellMetrics}), ).toEqual([0, 1]); }); @@ -81,7 +81,7 @@ describe('computeViewableItems', function () { }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 25, 200, {getCellMetrics}), ).toEqual([1]); }); @@ -93,7 +93,7 @@ describe('computeViewableItems', function () { rowFrames = {}; data = []; expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 0, 200, {getCellMetrics}), ).toEqual([]); }); @@ -108,48 +108,48 @@ describe('computeViewableItems', function () { data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; let helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 0}); - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. expect(helper.computeViewableItems(props, 0, 50, {getCellMetrics})).toEqual( [0], ); - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. expect(helper.computeViewableItems(props, 1, 50, {getCellMetrics})).toEqual( [0, 1], ); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 199, 50, {getCellMetrics}), ).toEqual([1, 2]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 250, 50, {getCellMetrics}), ).toEqual([2]); helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 100}); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 0, 200, {getCellMetrics}), ).toEqual([0, 1]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 1, 200, {getCellMetrics}), ).toEqual([1]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 400, 200, {getCellMetrics}), ).toEqual([2]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 600, 200, {getCellMetrics}), ).toEqual([3]); helper = new ViewabilityHelper({viewAreaCoveragePercentThreshold: 10}); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 30, 200, {getCellMetrics}), ).toEqual([0, 1, 2]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 31, 200, {getCellMetrics}), ).toEqual([1, 2]); }); @@ -163,36 +163,36 @@ describe('computeViewableItems', function () { }; data = [{key: 'a'}, {key: 'b'}, {key: 'c'}, {key: 'd'}]; let helper = new ViewabilityHelper({itemVisiblePercentThreshold: 0}); - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. expect(helper.computeViewableItems(props, 0, 50, {getCellMetrics})).toEqual( [0], ); - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. expect(helper.computeViewableItems(props, 1, 50, {getCellMetrics})).toEqual( [0, 1], ); helper = new ViewabilityHelper({itemVisiblePercentThreshold: 100}); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 0, 250, {getCellMetrics}), ).toEqual([0, 1, 2]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 1, 250, {getCellMetrics}), ).toEqual([1, 2]); helper = new ViewabilityHelper({itemVisiblePercentThreshold: 10}); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 184, 20, {getCellMetrics}), ).toEqual([1]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 185, 20, {getCellMetrics}), ).toEqual([1, 2]); expect( - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. helper.computeViewableItems(props, 186, 20, {getCellMetrics}), ).toEqual([2]); }); @@ -210,7 +210,7 @@ describe('onUpdate', function () { props, 0, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -225,7 +225,7 @@ describe('onUpdate', function () { props, 0, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -235,7 +235,7 @@ describe('onUpdate', function () { props, 100, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -260,7 +260,7 @@ describe('onUpdate', function () { props, 0, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -275,7 +275,7 @@ describe('onUpdate', function () { props, 100, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -294,7 +294,7 @@ describe('onUpdate', function () { props, 200, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -322,7 +322,7 @@ describe('onUpdate', function () { props, 0, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -357,7 +357,7 @@ describe('onUpdate', function () { props, 0, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -366,7 +366,7 @@ describe('onUpdate', function () { props, 300, // scroll past item 'a' 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -400,7 +400,7 @@ describe('onUpdate', function () { props, 0, 100, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -413,7 +413,7 @@ describe('onUpdate', function () { props, 20, 100, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -441,7 +441,7 @@ describe('onUpdate', function () { props, 0, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -467,7 +467,7 @@ describe('onUpdate', function () { props, 0, 200, - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetrics}, createViewToken, onViewableItemsChanged, @@ -507,7 +507,7 @@ describe('onUpdate', function () { testProps, 1503.61901855, // scrollOffset 411.4285583496094, // viewportHeight (viewportWidth depending on scrolling axis) - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. listMetrics, ); expect(viewableIndices).toEqual([0]); diff --git a/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js b/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js index 782c88b3d7c..6b6ba04d484 100644 --- a/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js +++ b/packages/virtualized-lists/Lists/__tests__/VirtualizeUtils-test.js @@ -60,7 +60,7 @@ describe('elementsThatOverlapOffsets', function () { elementsThatOverlapOffsets( offsets, fakeProps(100), - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetricsApprox}, 1, ), @@ -79,7 +79,7 @@ describe('elementsThatOverlapOffsets', function () { elementsThatOverlapOffsets( offsets, fakeProps(frames.length), - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetricsApprox: ii => frames[ii]}, 1, ), @@ -97,7 +97,7 @@ describe('elementsThatOverlapOffsets', function () { elementsThatOverlapOffsets( offsets, fakeProps(100), - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetricsApprox}, 1, ), @@ -114,7 +114,7 @@ describe('elementsThatOverlapOffsets', function () { elementsThatOverlapOffsets( offsets, fakeProps(frames.length), - // $FlowFixMe[incompatible-call] - Invalid `ListMetricsAggregator`. + // $FlowFixMe[incompatible-type] - Invalid `ListMetricsAggregator`. {getCellMetricsApprox: ii => frames[ii]}, 1, ), @@ -157,7 +157,7 @@ describe('computeWindowedRenderLimits', function () { getItemCount: () => 3, }; const result = computeWindowedRenderLimits( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] props, 5, 10, @@ -190,7 +190,7 @@ describe('computeWindowedRenderLimits', function () { expect( computeWindowedRenderLimits( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] { ...defaultProps, getItemCount: () => 8, @@ -202,7 +202,7 @@ describe('computeWindowedRenderLimits', function () { 31, {first: 0, last: 5}, listMetricsAggregator, - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] { dt: 949, dOffset: 879.2000732421875, @@ -228,7 +228,7 @@ describe('computeWindowedRenderLimits', function () { expect( computeWindowedRenderLimits( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] { ...defaultProps, getItemLayout: (_, index) => offsets[index], @@ -237,7 +237,7 @@ describe('computeWindowedRenderLimits', function () { 5, {first: 5, last: 9}, listMetricsAggregator, - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] { dt: 100, dOffset: 100, @@ -259,7 +259,7 @@ describe('computeWindowedRenderLimits', function () { }; const prev = {first: 0, last: 2}; const result = computeWindowedRenderLimits( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] defaultProps, 2, // maxToRenderPerBatch 5, // windowSize @@ -281,7 +281,7 @@ describe('computeWindowedRenderLimits', function () { visibleLength: 1000, }; const result = computeWindowedRenderLimits( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] props, 5, 10, // windowSize large enough to cover entire list diff --git a/private/react-native-fantom/runner/getFantomTestConfigs.js b/private/react-native-fantom/runner/getFantomTestConfigs.js index ff22613f607..be739cb1882 100644 --- a/private/react-native-fantom/runner/getFantomTestConfigs.js +++ b/private/react-native-fantom/runner/getFantomTestConfigs.js @@ -488,10 +488,10 @@ function parseFeatureFlagValue( switch (typeof defaultValue) { case 'boolean': if (value === 'true') { - // $FlowExpectedError[incompatible-return] at this point we know T is a boolean + // $FlowExpectedError[incompatible-type] at this point we know T is a boolean return true; } else if (value === 'false') { - // $FlowExpectedError[incompatible-return] at this point we know T is a boolean + // $FlowExpectedError[incompatible-type] at this point we know T is a boolean return false; } else { throw new Error(`Invalid value for boolean flag: ${value}`); @@ -503,10 +503,10 @@ function parseFeatureFlagValue( throw new Error(`Invalid value for number flag: ${value}`); } - // $FlowExpectedError[incompatible-return] at this point we know T is a number + // $FlowExpectedError[incompatible-type] at this point we know T is a number return parsed; case 'string': - // $FlowExpectedError[incompatible-return] at this point we know T is a string + // $FlowExpectedError[incompatible-type] at this point we know T is a string return value; default: throw new Error(`Unsupported feature flag type: ${typeof defaultValue}`); diff --git a/private/react-native-fantom/runtime/mocks.js b/private/react-native-fantom/runtime/mocks.js index 03642ec9dda..7394f352ee4 100644 --- a/private/react-native-fantom/runtime/mocks.js +++ b/private/react-native-fantom/runtime/mocks.js @@ -61,7 +61,7 @@ export function createMockFunction, TReturn>( mock.calls.push(args); mock.lastCall = args; - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] mock.instances.push(new.target ? this : undefined); mock.contexts.push(this); mock.results.push(result); @@ -77,6 +77,6 @@ export function createMockFunction, TReturn>( // $FlowExpectedError[invalid-computed-prop] mockFunction[MOCK_FN_TAG] = true; - // $FlowExpectedError[prop-missing] + // $FlowExpectedError[incompatible-type] return mockFunction; } diff --git a/private/react-native-fantom/src/__tests__/expect-itest.js b/private/react-native-fantom/src/__tests__/expect-itest.js index f63dc896bf5..a470135fe61 100644 --- a/private/react-native-fantom/src/__tests__/expect-itest.js +++ b/private/react-native-fantom/src/__tests__/expect-itest.js @@ -640,12 +640,12 @@ describe('expect', () => { // Should always throw if the expected value isn't a number expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).toBeLessThan('string value'); }).toThrow(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).not.toBeLessThan('string value'); }).toThrow(); }); @@ -675,12 +675,12 @@ describe('expect', () => { // Should always throw if the expected value isn't a number expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).toBeLessThanOrEqual('string value'); }).toThrow(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).not.toBeLessThanOrEqual('string value'); }).toThrow(); }); @@ -711,12 +711,12 @@ describe('expect', () => { // Should always throw if the expected value isn't a number expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).toBeGreaterThan('string value'); }).toThrow(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).not.toBeGreaterThan('string value'); }).toThrow(); }); @@ -746,12 +746,12 @@ describe('expect', () => { // Should always throw if the expected value isn't a number expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).toBeGreaterThanOrEqual('string value'); }).toThrow(); expect(() => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] expect(1).not.toBeGreaterThanOrEqual('string value'); }).toThrow(); }); diff --git a/private/react-native-fantom/src/index.js b/private/react-native-fantom/src/index.js index 936911026d2..3a9c1d6783e 100644 --- a/private/react-native-fantom/src/index.js +++ b/private/react-native-fantom/src/index.js @@ -94,7 +94,7 @@ class Root { const ReactFabric = require('react-native/Libraries/Renderer/shims/ReactFabric').default; - // $FlowExpectedError[incompatible-cast] + // $FlowExpectedError[incompatible-type] const surfaceIdIsNumber = this.#surfaceId as number; ReactFabric.render(element, surfaceIdIsNumber, null, true); diff --git a/scripts/build/build.js b/scripts/build/build.js index c184e7a3701..16576de8540 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -44,7 +44,7 @@ async function build() { const { positionals: packageNames, values: {validate, help}, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); @@ -189,7 +189,7 @@ async function buildFile( // Transform source file using Babel const transformed = await prettier.format( (await babel.transformFileAsync(file, getBabelConfig(packageName))).code, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ prettierConfig, ); diff --git a/scripts/build/clean.js b/scripts/build/clean.js index 13d17b6b9fb..b74a02216e3 100644 --- a/scripts/build/clean.js +++ b/scripts/build/clean.js @@ -25,7 +25,7 @@ const config = { function clean() { const { values: {help}, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/debugger-frontend/sync-and-build.js b/scripts/debugger-frontend/sync-and-build.js index 53829b92d2c..db1f613bb3c 100644 --- a/scripts/debugger-frontend/sync-and-build.js +++ b/scripts/debugger-frontend/sync-and-build.js @@ -62,7 +62,7 @@ async function main() { 'create-diff': createDiff, 'no-build': noBuild, }, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/e2e/init-project-e2e.js b/scripts/e2e/init-project-e2e.js index c807038a9e2..af396bb34cf 100644 --- a/scripts/e2e/init-project-e2e.js +++ b/scripts/e2e/init-project-e2e.js @@ -41,7 +41,7 @@ const config = { async function main() { const { values: {help, ...options}, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/js-api/build-types/buildApiSnapshot.js b/scripts/js-api/build-types/buildApiSnapshot.js index 88402b34a08..33e38076485 100644 --- a/scripts/js-api/build-types/buildApiSnapshot.js +++ b/scripts/js-api/build-types/buildApiSnapshot.js @@ -146,7 +146,7 @@ async function validateSnapshots( }; // $FlowFixMe[prop-missing] - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] const diffResult = diff(prevSnapshot, newSnapshot, options); const rerunCommand = isGitRepo() ? 'yarn build-types' : 'js1 build-js-api'; console.error( @@ -324,7 +324,7 @@ async function copyDirectory(src: string, dest: string) { } async function createTempDir(dirName: string): Promise { - // $FlowExpectedError[incompatible-call] temp-dir is typed as a default export + // $FlowExpectedError[incompatible-type] temp-dir is typed as a default export const tempDir = path.join(osTempDir, dirName); await fs.mkdir(tempDir, {recursive: true}); diff --git a/scripts/js-api/build-types/index.js b/scripts/js-api/build-types/index.js index 757fe58663a..86905c7d274 100644 --- a/scripts/js-api/build-types/index.js +++ b/scripts/js-api/build-types/index.js @@ -34,7 +34,7 @@ async function main() { 'skip-snapshot': skipSnapshot, validate, }, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js b/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js index 0627ca3a80f..4e8358df3cc 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js +++ b/scripts/js-api/build-types/transforms/flow/replaceEmptyWithNever.js @@ -16,7 +16,7 @@ const {transformAST} = require('hermes-transform/dist/transform/transformAST'); const visitors: TransformVisitor = context => ({ EmptyTypeAnnotation(node): void { - // $FlowExpectedError[incompatible-call] - GenericTypeAnnotation is not assignable to EmptyTypeAnnotation + // $FlowExpectedError[incompatible-type] - GenericTypeAnnotation is not assignable to EmptyTypeAnnotation context.replaceNode(node, { type: 'GenericTypeAnnotation', id: { diff --git a/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js b/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js index 8aa1a62fffd..b7ac98749a3 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js +++ b/scripts/js-api/build-types/transforms/flow/replaceNullablePropertiesWithUndefined.js @@ -32,7 +32,7 @@ const visitors: TransformVisitor = context => ({ return; } - // $FlowExpectedError[incompatible-call] - UnionTypeAnnotation is not assignable to NullableTypeAnnotation + // $FlowExpectedError[incompatible-type] - UnionTypeAnnotation is not assignable to NullableTypeAnnotation context.replaceNode(node, { type: 'UnionTypeAnnotation', types: [ diff --git a/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js b/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js index 203eccccf1c..7e7026bb4ee 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js +++ b/scripts/js-api/build-types/transforms/flow/replaceRequiresWithImports.js @@ -36,7 +36,7 @@ const visitors: TransformVisitor = context => ({ const requiredModule = node.declarations[0].init.arguments[0]; if (node.declarations[0].id.type === 'Identifier') { - // $FlowExpectedError[incompatible-call] - we are replacing an expression with a statement but in the top-level scope + // $FlowExpectedError[incompatible-type] - we are replacing an expression with a statement but in the top-level scope context.replaceNode(node, { type: 'ImportDeclaration', source: requiredModule, @@ -52,7 +52,7 @@ const visitors: TransformVisitor = context => ({ ], }); } else if (node.declarations[0].id.type === 'ObjectPattern') { - // $FlowExpectedError[incompatible-call] - we are replacing an expression with a statement but in the top-level scope + // $FlowExpectedError[incompatible-type] - we are replacing an expression with a statement but in the top-level scope context.replaceNode(node, { type: 'ImportDeclaration', source: requiredModule, @@ -103,7 +103,7 @@ const visitors: TransformVisitor = context => ({ // Special treatment for `require().default` case to transform it to // a default import if (node.declarations[0].init.property.name === 'default') { - // $FlowExpectedError[incompatible-call] - we are replacing an expression with a statement but in the top-level scope + // $FlowExpectedError[incompatible-type] - we are replacing an expression with a statement but in the top-level scope context.replaceNode(node, { type: 'ImportDeclaration', source: requiredModule, @@ -119,7 +119,7 @@ const visitors: TransformVisitor = context => ({ ], }); } else { - // $FlowExpectedError[incompatible-call] - we are replacing an expression with a statement but in the top-level scope + // $FlowExpectedError[incompatible-type] - we are replacing an expression with a statement but in the top-level scope context.replaceNode(node, { type: 'ImportDeclaration', source: requiredModule, @@ -142,7 +142,7 @@ const visitors: TransformVisitor = context => ({ } } else if (node.declarations[0].init.property.type === 'Literal') { // Handle member access via bracket notation - // $FlowExpectedError[incompatible-call] - we are replacing an expression with a statement but in the top-level + // $FlowExpectedError[incompatible-type] - we are replacing an expression with a statement but in the top-level context.replaceNode(node, { type: 'ImportDeclaration', source: requiredModule, diff --git a/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js b/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js index 48e53c6c654..619d9362907 100644 --- a/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js +++ b/scripts/js-api/build-types/transforms/flow/replaceStringishWithString.js @@ -17,7 +17,7 @@ const {transformAST} = require('hermes-transform/dist/transform/transformAST'); const visitors: TransformVisitor = context => ({ GenericTypeAnnotation(node): void { if (node.id.name === 'Stringish') { - // $FlowExpectedError[incompatible-call] - GenericTypeAnnotation is not assignable to EmptyTypeAnnotation + // $FlowExpectedError[incompatible-type] - GenericTypeAnnotation is not assignable to EmptyTypeAnnotation context.replaceNode(node, { type: 'GenericTypeAnnotation', id: { diff --git a/scripts/js-api/build-types/transforms/typescript/organizeDeclarations.js b/scripts/js-api/build-types/transforms/typescript/organizeDeclarations.js index 54494d25df5..e9ecfa5a257 100644 --- a/scripts/js-api/build-types/transforms/typescript/organizeDeclarations.js +++ b/scripts/js-api/build-types/transforms/typescript/organizeDeclarations.js @@ -79,7 +79,7 @@ const visitor: PluginObj = { if (exportedIdentifiers.size > 0) { const sortedIdentifiers = Array.from(exportedIdentifiers).sort(); const exportStatement = t.exportNamedDeclaration( - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] null, sortedIdentifiers.map(name => t.exportSpecifier(t.identifier(name), t.identifier(name)), diff --git a/scripts/js-api/build-types/transforms/typescript/versionExportedApis.js b/scripts/js-api/build-types/transforms/typescript/versionExportedApis.js index 836f24733ff..1902c4f8062 100644 --- a/scripts/js-api/build-types/transforms/typescript/versionExportedApis.js +++ b/scripts/js-api/build-types/transforms/typescript/versionExportedApis.js @@ -79,7 +79,7 @@ function createVersionExportedApis( if (t.isTSModuleDeclaration(node) && node.body) { const namespaceName = node.id.name; - // $FlowFixMe[prop-missing] + // $FlowFixMe[incompatible-type] for (const item of node.body.body) { if (t.isExportNamedDeclaration(item) && item.specifiers) { for (const specifier of item.specifiers) { diff --git a/scripts/js-api/build-types/utils/applyBabelTransformsSeq.js b/scripts/js-api/build-types/utils/applyBabelTransformsSeq.js index 5a09fea0700..3c26e0f92d4 100644 --- a/scripts/js-api/build-types/utils/applyBabelTransformsSeq.js +++ b/scripts/js-api/build-types/utils/applyBabelTransformsSeq.js @@ -33,7 +33,7 @@ async function applyBabelTransformsSeq( if (result == null) { throw new Error('Unexpected null result from Babel transform'); } - // $FlowFixMe[incompatible-cast] + // $FlowFixMe[incompatible-type] return result.ast as BabelNodeFile; }); }, Promise.resolve(parsed)); diff --git a/scripts/js-api/diff-api-snapshot/index.js b/scripts/js-api/diff-api-snapshot/index.js index 4c9f3fc6c0e..499a33f0fe4 100644 --- a/scripts/js-api/diff-api-snapshot/index.js +++ b/scripts/js-api/diff-api-snapshot/index.js @@ -26,7 +26,7 @@ async function main() { const { positionals: [prevSnapshot, newSnapshot], values: {help}, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/release-testing/utils/github-actions-utils.js b/scripts/release-testing/utils/github-actions-utils.js index be14b0bed68..92574b06fbf 100644 --- a/scripts/release-testing/utils/github-actions-utils.js +++ b/scripts/release-testing/utils/github-actions-utils.js @@ -81,7 +81,7 @@ async function _getActionRunsOnBranch() /*: Promise */ { }; // $FlowFixMe[prop-missing] Conflicting .flowconfig in Meta's monorepo - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] const response = await fetch(url, options); if (!response.ok) { throw new Error(JSON.stringify(await response.json())); @@ -101,7 +101,7 @@ async function _getArtifacts(run_id /*: number */) /*: Promise */ { }; // $FlowFixMe[prop-missing] Conflicting .flowconfig in Meta's monorepo - // $FlowFixMe[incompatible-call] + // $FlowFixMe[incompatible-type] const response = await fetch(url, options); if (!response.ok) { throw new Error(JSON.stringify(await response.json())); diff --git a/scripts/releases-ci/__tests__/publish-npm-test.js b/scripts/releases-ci/__tests__/publish-npm-test.js index 0ab84e5536d..9986205f5b8 100644 --- a/scripts/releases-ci/__tests__/publish-npm-test.js +++ b/scripts/releases-ci/__tests__/publish-npm-test.js @@ -82,7 +82,7 @@ describe('publish-npm', () => { getNpmInfoMock.mockImplementation(npmUtils.getNpmInfo); await expect(async () => { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] await publishNpm('invalid'); }).rejects.toThrow('Unsupported build type: invalid'); }); diff --git a/scripts/releases-ci/publish-updated-packages.js b/scripts/releases-ci/publish-updated-packages.js index 2a9e7c18173..5a9726fb2f8 100644 --- a/scripts/releases-ci/publish-updated-packages.js +++ b/scripts/releases-ci/publish-updated-packages.js @@ -25,7 +25,7 @@ const config = { async function main() { const { values: {help}, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/releases/set-rn-artifacts-version.js b/scripts/releases/set-rn-artifacts-version.js index 2b1cd29573c..bf867123718 100755 --- a/scripts/releases/set-rn-artifacts-version.js +++ b/scripts/releases/set-rn-artifacts-version.js @@ -45,7 +45,7 @@ const config = { async function main() { const { values: {help, 'build-type': buildType, 'to-version': toVersion}, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/releases/set-version.js b/scripts/releases/set-version.js index 33f5054a094..203d6983956 100644 --- a/scripts/releases/set-version.js +++ b/scripts/releases/set-version.js @@ -36,7 +36,7 @@ async function main() { const { positionals: [version], values: {help, skipReactNativeVersion}, - /* $FlowFixMe[incompatible-call] Natural Inference rollout. See + /* $FlowFixMe[incompatible-type] Natural Inference rollout. See * https://fburl.com/workplace/6291gfvu */ } = parseArgs(config); diff --git a/scripts/releases/utils/__tests__/version-utils-test.js b/scripts/releases/utils/__tests__/version-utils-test.js index f880bfb4ce7..b329ed71b7f 100644 --- a/scripts/releases/utils/__tests__/version-utils-test.js +++ b/scripts/releases/utils/__tests__/version-utils-test.js @@ -43,7 +43,7 @@ describe('version-utils', () => { describe('parseVersion', () => { it('should throw error if buildType is not `release`, `dry-run` or `nightly`', () => { function testInvalidVersion() { - // $FlowExpectedError[incompatible-call] + // $FlowExpectedError[incompatible-type] parseVersion('v0.10.5', 'invalid_build_type'); } expect(testInvalidVersion).toThrowErrorMatchingInlineSnapshot( diff --git a/scripts/releases/utils/scm-utils.js b/scripts/releases/utils/scm-utils.js index d0296adaf41..986ae22453f 100644 --- a/scripts/releases/utils/scm-utils.js +++ b/scripts/releases/utils/scm-utils.js @@ -37,7 +37,7 @@ function exitIfNotOnGit /*::*/( command /*: () => T */, errorMessage /*: string */, gracefulExit /*: boolean */ = false, - // $FlowFixMe[incompatible-return] Asserts return value + // $FlowFixMe[incompatible-type] Asserts return value ) /*: T */ { if (isGitRepo()) { return command(); diff --git a/scripts/releases/utils/version-utils.js b/scripts/releases/utils/version-utils.js index 6d530b5cfa3..b724645ff05 100644 --- a/scripts/releases/utils/version-utils.js +++ b/scripts/releases/utils/version-utils.js @@ -64,7 +64,7 @@ function validateBuildType( ) /*: buildType is BuildType */ { const validBuildTypes = new Set(['release', 'dry-run', 'nightly']); - // $FlowFixMe[incompatible-return] + // $FlowFixMe[incompatible-type] // $FlowFixMe[incompatible-type-guard] return validBuildTypes.has(buildType); }