From f2052fedc2db0bc8a460d0e66a9eb6dad3c2f92f Mon Sep 17 00:00:00 2001 From: Pieter Vanderwerff Date: Thu, 7 Jan 2021 11:31:16 -0800 Subject: [PATCH] Land suppressions for 0.142.0 release to xplat Summary: This change contains the suppressions for the up coming v0.142.0 Flow release. The new suppressions are a result the following changes: * Disallow flowing functions or inexact objects to indexed objects to improve object soundness. This can cause errors if you are passing a function or inexact objects when an indexed object is expected. * Flow now processes imports before checking the body of a file. In some rare cases this can expose previously skipped errors due to the processing order. Reviewed By: mroch Differential Revision: D25820434 fbshipit-source-id: 59cc1d852ffc8cc39f0d5112ce485fb33f05c092 --- Libraries/Animated/AnimatedEvent.js | 1 + Libraries/Pressability/__tests__/Pressability-test.js | 6 ++++++ Libraries/StyleSheet/splitLayoutProps.js | 2 ++ Libraries/Text/TextNativeComponent.js | 2 ++ 4 files changed, 11 insertions(+) diff --git a/Libraries/Animated/AnimatedEvent.js b/Libraries/Animated/AnimatedEvent.js index 98ff42eb197..87a434752be 100644 --- a/Libraries/Animated/AnimatedEvent.js +++ b/Libraries/Animated/AnimatedEvent.js @@ -74,6 +74,7 @@ function attachNativeEvent( NativeAnimatedHelper.API.removeAnimatedEventFromView( viewTag, eventName, + // $FlowFixMe[incompatible-call] mapping.animatedValueTag, ); }); diff --git a/Libraries/Pressability/__tests__/Pressability-test.js b/Libraries/Pressability/__tests__/Pressability-test.js index d584d215b7c..b0be50280ee 100644 --- a/Libraries/Pressability/__tests__/Pressability-test.js +++ b/Libraries/Pressability/__tests__/Pressability-test.js @@ -716,7 +716,9 @@ describe('Pressability', () => { handlers.onResponderMove( createMockPressEvent({ registrationName: 'onResponderMove', + // $FlowFixMe[unsafe-addition] pageX: mockRegion.width + mockSlop.right / 2, + // $FlowFixMe[unsafe-addition] pageY: mockRegion.height + mockSlop.bottom / 2, }), ); @@ -750,7 +752,9 @@ describe('Pressability', () => { handlers.onResponderMove( createMockPressEvent({ registrationName: 'onResponderMove', + // $FlowFixMe[unsafe-addition] pageX: mockRegion.width + mockSlop.right / 2, + // $FlowFixMe[unsafe-addition] pageY: mockRegion.height + mockSlop.bottom / 2, }), ); @@ -870,9 +874,11 @@ describe('Pressability', () => { config.onStartShouldSetResponder_DEPRECATED, ); + // $FlowFixMe[prop-missing] onStartShouldSetResponder_DEPRECATED.mockReturnValue(false); expect(handlers.onStartShouldSetResponder()).toBe(false); + // $FlowFixMe[prop-missing] onStartShouldSetResponder_DEPRECATED.mockReturnValue(true); expect(handlers.onStartShouldSetResponder()).toBe(true); }); diff --git a/Libraries/StyleSheet/splitLayoutProps.js b/Libraries/StyleSheet/splitLayoutProps.js index 03bb726001e..491da11c45f 100644 --- a/Libraries/StyleSheet/splitLayoutProps.js +++ b/Libraries/StyleSheet/splitLayoutProps.js @@ -55,9 +55,11 @@ export default function splitLayoutProps( case 'bottom': case 'top': case 'transform': + // $FlowFixMe[cannot-write] outer[prop] = props[prop]; break; default: + // $FlowFixMe[cannot-write] inner[prop] = props[prop]; break; } diff --git a/Libraries/Text/TextNativeComponent.js b/Libraries/Text/TextNativeComponent.js index b98dca5a5b3..742c2931cd5 100644 --- a/Libraries/Text/TextNativeComponent.js +++ b/Libraries/Text/TextNativeComponent.js @@ -26,6 +26,7 @@ type NativeTextProps = $ReadOnly<{ export const NativeText: HostComponent = (createReactNativeComponentClass( 'RCTText', () => ({ + // $FlowFixMe[incompatible-call] validAttributes: { ...ReactNativeViewAttributes.UIView, isHighlighted: true, @@ -60,6 +61,7 @@ export const NativeVirtualText: HostComponent = UIManager.getViewManagerConfig('RCTVirtualText') == null ? NativeText : (createReactNativeComponentClass('RCTVirtualText', () => ({ + // $FlowFixMe[incompatible-call] validAttributes: { ...ReactNativeViewAttributes.UIView, isHighlighted: true,