diff --git a/.flowconfig b/.flowconfig index 1c5251aa55048e..c7c1c4d19621e2 100644 --- a/.flowconfig +++ b/.flowconfig @@ -74,4 +74,4 @@ untyped-import untyped-type-import [version] -^0.185.1 +^0.186.0 diff --git a/.flowconfig.android b/.flowconfig.android index 96e4b59c23a729..a3572186109c56 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -74,4 +74,4 @@ untyped-import untyped-type-import [version] -^0.185.1 +^0.186.0 diff --git a/Libraries/Animated/nodes/AnimatedValue.js b/Libraries/Animated/nodes/AnimatedValue.js index 9530e090f923d7..4d6f37b2f02591 100644 --- a/Libraries/Animated/nodes/AnimatedValue.js +++ b/Libraries/Animated/nodes/AnimatedValue.js @@ -91,6 +91,7 @@ class AnimatedValue extends AnimatedWithChildren { _animation: ?Animation; _tracking: ?AnimatedTracking; + // $FlowFixMe[missing-local-annot] constructor(value: number, config?: ?AnimatedValueConfig) { super(); if (typeof value !== 'number') { diff --git a/Libraries/Blob/URL.js b/Libraries/Blob/URL.js index 2a5572bea0ff5e..1cc3a9e8c4a2cb 100644 --- a/Libraries/Blob/URL.js +++ b/Libraries/Blob/URL.js @@ -135,6 +135,7 @@ export class URL { // Do nothing. } + // $FlowFixMe[missing-local-annot] constructor(url: string, base: string | URL) { let baseUrl = null; if (!base || validateBaseUrl(url)) { diff --git a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js index dfc0b932d15d66..556db6835801d5 100644 --- a/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +++ b/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js @@ -330,7 +330,8 @@ const AccessibilityInfo: AccessibilityInfoType = { const deviceEventName = EventNames.get(eventName); return deviceEventName == null ? {remove(): void {}} - : RCTDeviceEventEmitter.addListener(deviceEventName, handler); + : // $FlowFixMe[incompatible-call] + RCTDeviceEventEmitter.addListener(deviceEventName, handler); }, /** diff --git a/Libraries/Lists/VirtualizedList.js b/Libraries/Lists/VirtualizedList.js index 2e06c88e6eac41..514162d7ec46f3 100644 --- a/Libraries/Lists/VirtualizedList.js +++ b/Libraries/Lists/VirtualizedList.js @@ -1030,6 +1030,7 @@ class VirtualizedList extends React.PureComponent { ); return ( // $FlowFixMe[prop-missing] Invalid prop usage + // $FlowFixMe[incompatible-use] { ); } else { // $FlowFixMe[prop-missing] Invalid prop usage + // $FlowFixMe[incompatible-use] return ; } }; diff --git a/Libraries/Lists/VirtualizedList_EXPERIMENTAL.js b/Libraries/Lists/VirtualizedList_EXPERIMENTAL.js index d08f2610fc3761..4641ec0b0860d1 100644 --- a/Libraries/Lists/VirtualizedList_EXPERIMENTAL.js +++ b/Libraries/Lists/VirtualizedList_EXPERIMENTAL.js @@ -1226,6 +1226,7 @@ class VirtualizedList extends StateSafePureComponent { ); return ( // $FlowFixMe[prop-missing] Invalid prop usage + // $FlowFixMe[incompatible-use] { ); } else { // $FlowFixMe[prop-missing] Invalid prop usage + // $FlowFixMe[incompatible-use] return ; } }; diff --git a/Libraries/Network/RCTNetworking.ios.js b/Libraries/Network/RCTNetworking.ios.js index e0a6e6e0002d14..692ce6315516a3 100644 --- a/Libraries/Network/RCTNetworking.ios.js +++ b/Libraries/Network/RCTNetworking.ios.js @@ -68,6 +68,7 @@ const RCTNetworking = { listener: (...$ElementType) => mixed, context?: mixed, ): EventSubscription { + // $FlowFixMe[incompatible-call] return RCTDeviceEventEmitter.addListener(eventType, listener, context); }, diff --git a/Libraries/Utilities/Platform.android.js b/Libraries/Utilities/Platform.android.js index 5ef0b399e5b8b5..9dd53d84791190 100644 --- a/Libraries/Utilities/Platform.android.js +++ b/Libraries/Utilities/Platform.android.js @@ -22,6 +22,7 @@ const Platform = { OS: 'android', // $FlowFixMe[unsafe-getters-setters] get Version(): number { + // $FlowFixMe[object-this-reference] return this.constants.Version; }, // $FlowFixMe[unsafe-getters-setters] @@ -43,20 +44,25 @@ const Platform = { Brand: string, Manufacturer: string, |} { + // $FlowFixMe[object-this-reference] if (this.__constants == null) { + // $FlowFixMe[object-this-reference] this.__constants = NativePlatformConstantsAndroid.getConstants(); } + // $FlowFixMe[object-this-reference] return this.__constants; }, // $FlowFixMe[unsafe-getters-setters] get isTesting(): boolean { if (__DEV__) { + // $FlowFixMe[object-this-reference] return this.constants.isTesting; } return false; }, // $FlowFixMe[unsafe-getters-setters] get isTV(): boolean { + // $FlowFixMe[object-this-reference] return this.constants.uiMode === 'tv'; }, select: (spec: PlatformSelectSpec): A | N | D => diff --git a/Libraries/Utilities/Platform.ios.js b/Libraries/Utilities/Platform.ios.js index fc18ed727469ef..07fd365d496275 100644 --- a/Libraries/Utilities/Platform.ios.js +++ b/Libraries/Utilities/Platform.ios.js @@ -22,6 +22,7 @@ const Platform = { OS: 'ios', // $FlowFixMe[unsafe-getters-setters] get Version(): string { + // $FlowFixMe[object-this-reference] return this.constants.osVersion; }, // $FlowFixMe[unsafe-getters-setters] @@ -38,22 +39,28 @@ const Platform = { |}, systemName: string, |} { + // $FlowFixMe[object-this-reference] if (this.__constants == null) { + // $FlowFixMe[object-this-reference] this.__constants = NativePlatformConstantsIOS.getConstants(); } + // $FlowFixMe[object-this-reference] return this.__constants; }, // $FlowFixMe[unsafe-getters-setters] get isPad(): boolean { + // $FlowFixMe[object-this-reference] return this.constants.interfaceIdiom === 'pad'; }, // $FlowFixMe[unsafe-getters-setters] get isTV(): boolean { + // $FlowFixMe[object-this-reference] return this.constants.interfaceIdiom === 'tv'; }, // $FlowFixMe[unsafe-getters-setters] get isTesting(): boolean { if (__DEV__) { + // $FlowFixMe[object-this-reference] return this.constants.isTesting; } return false; diff --git a/package.json b/package.json index b04a15f4701b90..b3307805f7a3e2 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "ws": "^6.1.4" }, "devDependencies": { - "flow-bin": "^0.185.1", + "flow-bin": "^0.186.0", "hermes-eslint": "0.8.0", "react": "18.2.0", "react-test-renderer": "^18.2.0" diff --git a/packages/react-native-codegen/src/parsers/flow/modules/errors.js b/packages/react-native-codegen/src/parsers/flow/modules/errors.js index b694800198ccfe..9314565c32fc16 100644 --- a/packages/react-native-codegen/src/parsers/flow/modules/errors.js +++ b/packages/react-native-codegen/src/parsers/flow/modules/errors.js @@ -100,6 +100,7 @@ class IncorrectlyParameterizedFlowGenericParserError extends ParserError { +genericName: string; +numTypeParameters: number; + // $FlowFixMe[missing-local-annot] constructor(hasteModuleName: string, genericTypeAnnotation: $FlowFixMe) { if (genericTypeAnnotation.typeParameters == null) { super( diff --git a/packages/react-native-codegen/src/parsers/typescript/modules/errors.js b/packages/react-native-codegen/src/parsers/typescript/modules/errors.js index 60cf42b2d347cb..9cc1470c9d8802 100644 --- a/packages/react-native-codegen/src/parsers/typescript/modules/errors.js +++ b/packages/react-native-codegen/src/parsers/typescript/modules/errors.js @@ -100,6 +100,7 @@ class IncorrectlyParameterizedTypeScriptGenericParserError extends ParserError { +genericName: string; +numTypeParameters: number; + // $FlowFixMe[missing-local-annot] constructor(hasteModuleName: string, genericTypeAnnotation: $FlowFixMe) { if (genericTypeAnnotation.typeParameters == null) { super( diff --git a/repo-config/package.json b/repo-config/package.json index 552a56e85c256b..9bb7ed9a48b5c9 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -32,7 +32,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-native": "^4.0.0", "eslint-plugin-relay": "^1.8.3", - "flow-bin": "^0.185.1", + "flow-bin": "^0.186.0", "inquirer": "^7.1.0", "jest": "^26.6.3", "jest-junit": "^10.0.0", diff --git a/template/_flowconfig b/template/_flowconfig index 6450da501c2dbf..230bbb2232af39 100644 --- a/template/_flowconfig +++ b/template/_flowconfig @@ -63,4 +63,4 @@ untyped-import untyped-type-import [version] -^0.185.1 +^0.186.0 diff --git a/yarn.lock b/yarn.lock index 4d8e79d49d4422..3a65b3a581d5ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3252,10 +3252,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -flow-bin@^0.185.1: - version "0.185.1" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.185.1.tgz#dbd3728405ff5aefd147e6c30a27381e9926ffb1" - integrity sha512-TUDZmyXpyKZin3oYtPke1wS5mT2ErCXEPuPsX1s6GgWhP7H7Z/qj6pg7CPcCYt5yNn2Im6k5VWx6J7/5a2stXA== +flow-bin@^0.186.0: + version "0.186.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.186.0.tgz#b60b720dea977516db8e77fdd3911f66e86c6378" + integrity sha512-p5g03TsAipO6Wu22rpphRZQ9EYuhVWANN698MRLWRyP7ZtkEyCpFHDfmzRHM4Ym/tbCQCMdLJ9JX/GmuiDsB2w== flow-parser@0.*: version "0.163.0"