Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/debugger-shell/src/electron/SettingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @oncall react_native
*/

// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
const {app} = require('electron') as any;
const fs = require('node:fs');
const path = require('node:path');
Expand Down
1 change: 0 additions & 1 deletion packages/dev-middleware/src/__tests__/FetchUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export function withFetchSelfSignedCertsForAllTests(
// For some reason, setting the `selfSignedCertDispatcher` with `setGlobalDispatcher` doesn't work.
// Instead of using `setGlobalDispatcher`, we'll use a spy to intercept the fetch calls and add the dispatcher.
fetchSpy.mockImplementation((url, options) =>
// $FlowFixMe[cannot-spread-interface]
fetchOriginal(url, {
...options,
// $FlowFixMe[prop-missing]: dispatcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ 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-type]
// $FlowFixMe[incompatible-indexer]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export async function sendFromTargetToDebugger<
: debugger_.handle.mock.calls;
// $FlowFixMe[incompatible-type]
const [receivedMessage]: [Message] = newHandleCalls.find(
// $FlowFixMe[incompatible-type]
(call: [Message]) => call[0].method === message.method,
);
return receivedMessage;
Expand Down
2 changes: 0 additions & 2 deletions packages/dev-middleware/src/inspector-proxy/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ export default class Device {
});

const cdpDebugLogging = this.#cdpDebugLogging;
// $FlowFixMe[method-unbinding]
const sendFunc = socket.send;
// $FlowFixMe[cannot-write]
socket.send = function (message: string) {
Expand Down Expand Up @@ -1156,7 +1155,6 @@ export default class Device {
// Fetch text, raising an exception if the text could not be fetched,
// or is too large.
async #fetchText(url: URL): Promise<string> {
// $FlowFixMe[incompatible-call] Suppress arvr node-fetch flow error
const response = await fetch(url);
if (!response.ok) {
throw new Error('HTTP ' + response.status + ' ' + response.statusText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @format
*/

// $FlowFixMe[cannot-resolve-module] libdef missing in RN OSS
import type {DebuggerSessionIDs} from '../types/EventReporter';

import {monitorEventLoopDelay, performance} from 'node:perf_hooks';
Expand Down
3 changes: 0 additions & 3 deletions packages/dev-middleware/src/inspector-proxy/InspectorProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
// well-behaved and the debugger is prepared to handle large messages.
maxPayload: 0,
});
// $FlowFixMe[value-as-type]
wss.on('connection', async (socket: WS, req) => {
const wssTimestamp = Date.now();

Expand Down Expand Up @@ -492,7 +491,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
// well-behaved and the device is prepared to handle large messages.
maxPayload: 0,
// Verify the client is from an allowed origin.
// $FlowFixMe[incompatible-type] - `ws` definition is incomplete.
verifyClient: (
info: Readonly<{
origin: string,
Expand Down Expand Up @@ -522,7 +520,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
},
});

// $FlowFixMe[value-as-type]
wss.on('connection', async (socket: WS, req) => {
const wssTimestamp = Date.now();

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-preset/jest/mockComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function mockComponent<
moduleName: string,
instanceMethods: ?interface {},
isESModule: TIsESModule,
): TIsESModule extends true // $FlowFixMe[incompatible-use]
): TIsESModule extends true
? ModuleDefault<TComponentModule & typeof instanceMethods>
: TComponentModule & typeof instanceMethods {
const RealComponent: TComponentType = isESModule
Expand Down
3 changes: 0 additions & 3 deletions packages/jest-preset/jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ Object.defineProperties(global, {
configurable: true,
enumerable: true,
value: {
// $FlowFixMe[method-unbinding]
// $FlowFixMe[incompatible-type]
now: jest.fn(Date.now),
},
writable: true,
Expand Down Expand Up @@ -177,7 +175,6 @@ mock(
mock(
// $FlowFixMe[cannot-resolve-module]
'm#react-native/Libraries/ReactNative/RendererProxy',
// $FlowFixMe[incompatible-type] - `./mocks/RendererProxy` is incomplete.
'm#./mocks/RendererProxy',
);
mock(
Expand Down
2 changes: 0 additions & 2 deletions packages/polyfills/__tests__/consoleTable-itest.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ describe('console.table(data, rows)', () => {
{third: 7, fourth: 8},
{fifth: 9},
],
// $FlowExpectedError[extra-arg]
['first', 'fifth'],
);
expect(logFn).toHaveBeenCalledTimes(1);
Expand All @@ -257,7 +256,6 @@ describe('console.table(data, rows)', () => {
c: {third: 7, fourth: 8},
d: {fifth: 9},
},
// $FlowExpectedError[extra-arg]
['first', 'fifth'],
);
expect(logFn).toHaveBeenCalledTimes(1);
Expand Down
1 change: 0 additions & 1 deletion packages/polyfills/__tests__/consoleTimeStamp-itest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('console.timeStamp()', () => {
});

it("doesn't throw when label is not specified", () => {
// $FlowExpectedError[incompatible-call] not passing label intentionally
expect(() => console.timeStamp()).not.toThrow();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ function mergeConfigs<T extends {}>(
base: T,
...overrides: ReadonlyArray<Partial<T>>
): T {
// $FlowExpectedError[incompatible-return] - Testing spread syntax
// $FlowExpectedError[incompatible-type] - Testing spread syntax
return {...base, ...overrides.reduce((acc, o) => ({...acc, ...o}), {})};
}
Expand Down
1 change: 0 additions & 1 deletion packages/react-native-babel-transformer/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ const getBabelRC = (function () {
// If a babel config file doesn't exist in the project then
// the default preset for react-native will be used instead.
// $FlowFixMe[incompatible-use] `extends` is missing in null or undefined.
// $FlowFixMe[incompatible-type] `extends` is missing in null or undefined.
if (!babelRC.extends) {
const {
babelRuntimeModuleName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,15 @@ function getLocalImports(
const objectImports = getImports(objectProps);
// $FlowFixMe[incompatible-type] the type is guaranteed to be ObjectTypeAnnotation<PropTypeAnnotation>
const localImports = getLocalImports(objectProps);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
objectImports.forEach(imports.add, imports);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
localImports.forEach(imports.add, imports);
}

if (typeAnnotation.type === 'ObjectTypeAnnotation') {
imports.add('#include <React/RendererCore.h>');
const objectImports = getImports(typeAnnotation.properties);
const localImports = getLocalImports(typeAnnotation.properties);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
objectImports.forEach(imports.add, imports);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
localImports.forEach(imports.add, imports);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ function getImports(

if (typeAnnotation.type === 'ObjectTypeAnnotation') {
const objectImports = getImports(typeAnnotation.properties);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
objectImports.forEach(imports.add, imports);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ module.exports = {
const argIncludes = getImports(
event.typeAnnotation.argument.properties,
);
// $FlowFixMe[method-unbinding]
argIncludes.forEach(extraIncludes.add, extraIncludes);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ module.exports = {
);

const imports = getImports(component.props);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
imports.forEach(allImports.add, allImports);

const replacedTemplate = ComponentTemplate({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -893,9 +893,7 @@ module.exports = {
const extendsImports = getExtendsImports(component.extendsProps);
const imports = getLocalImports(component.props);

// $FlowFixMe[method-unbinding] added when improving typing for this parameters
extendsImports.forEach(allImports.add, allImports);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
imports.forEach(allImports.add, allImports);

const replacedTemplate = ClassTemplate({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ function getTestCasesForProp(
propName: propName,
propValue: typeAnnotation.default != null ? typeAnnotation.default : true,
});
// $FlowFixMe[incompatible-type]
/* $FlowFixMe[invalid-compare] Error discovered during Constant Condition
* roll out. See https://fburl.com/workplace/4oq3zi07. */
} else if (typeAnnotation.type === 'IntegerTypeAnnotation') {
Expand Down Expand Up @@ -196,7 +195,6 @@ module.exports = {
const name = `${componentName}Props`;

const imports = getImports(component.props);
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
imports.forEach(allImports.add, allImports);

return generateTestsString(name, component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ const {
const {getTypeArguments} = require('../../utils');

function getPropertyType(
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
* LTI update could not be added via codemod */
name: string,
optional: boolean,
typeAnnotation: $FlowFixMe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const {
const {getCommands} = require('./commands');
const {getEvents} = require('./events');

// $FlowFixMe[signature-verification-failure] there's no flowtype for AST
function buildComponentSchema(
ast: $FlowFixMe,
parser: Parser,
Expand Down
2 changes: 0 additions & 2 deletions packages/react-native-codegen/src/parsers/parsers-commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,8 +1131,6 @@ function buildPropSchema(
};
}

/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
* LTI update could not be added via codemod */
function getEventArgument(
argumentProps: PropAST,
parser: Parser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ function translateArrayTypeAnnotation(

return wrapNullable(nullable, {
type: 'ArrayTypeAnnotation',
// $FlowFixMe[incompatible-type]
elementType: wrapNullable(isElementTypeNullable, _elementType),
});
} catch (ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ const {getCommands} = require('./commands');
const {getEvents} = require('./events');
const {categorizeProps} = require('./extends');

// $FlowFixMe[unclear-type] TODO(T108222691): Use flow-types for @babel/parser
type PropsAST = Object;

// $FlowFixMe[signature-verification-failure] TODO(T108222691): Use flow-types for @babel/parser
function buildComponentSchema(
ast: $FlowFixMe,
parser: Parser,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const {
} = require('./components/componentsUtils');
const {typeScriptTranslateTypeAnnotation} = require('./modules');
const {parseTopLevelType} = require('./parseTopLevelType');
// $FlowFixMe[untyped-import] Use flow-types for @babel/parser
const babelParser = require('@babel/parser');
const invariant = require('invariant');
const fs = require('node:fs');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,6 @@ function compareArrayTypesOutOfOrder(
potentiallyRemovedElements,
// I'm not sure how I should fix this FlowFixMe. It returns `undefined`
// and has existed since the day it was written. Fixing it might break things.
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
nestedChanges.concat[[oldTypePosn, newTypePosn, currentResult]],
);
case 'error':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export type ShareActionSheetIOSOptions = Readonly<{
export type ShareActionSheetError = Readonly<{
domain: string,
code: string,
// $FlowFixMe[unclear-type]
userInfo?: ?Object,
message: string,
}>;
Expand Down Expand Up @@ -127,11 +126,8 @@ const ActionSheetIOS = {
RCTActionSheetManager.showActionSheetWithOptions(
{
...remainingOptions,
// $FlowFixMe[incompatible-type]
tintColor: processedTintColor,
// $FlowFixMe[incompatible-type]
cancelButtonTintColor: processedCancelButtonTintColor,
// $FlowFixMe[incompatible-type]
disabledButtonTintColor: processedDisabledButtonTintColor,
destructiveButtonIndices,
},
Expand All @@ -156,9 +152,7 @@ const ActionSheetIOS = {
*/
showShareActionSheetWithOptions(
options: ShareActionSheetIOSOptions,
// $FlowFixMe[unclear-type]
failureCallback: Function | ((error: ShareActionSheetError) => void),
// $FlowFixMe[unclear-type]
successCallback: Function | ((success: boolean, method: ?string) => void),
) {
invariant(
Expand Down
5 changes: 0 additions & 5 deletions packages/react-native/Libraries/Animated/AnimatedEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,10 @@ export class AnimatedEvent {
this.__platformConfig = resolvedConfig.platformConfig;
}

// $FlowFixMe[unclear-type]
__addListener(callback: Function): void {
this._listeners.push(callback);
}

// $FlowFixMe[unclear-type]
__removeListener(callback: Function): void {
this._listeners = this._listeners.filter(listener => listener !== callback);
}
Expand Down Expand Up @@ -257,9 +255,6 @@ export class AnimatedEvent {
}
} else if (typeof recMapping === 'object') {
for (const mappingKey in recMapping) {
/* $FlowFixMe[prop-missing] (>=0.120.0) This comment suppresses an
* error found when Flow v0.120 was deployed. To see the error,
* delete this comment and run Flow. */
traverse(recMapping[mappingKey], recEvt[mappingKey]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,6 @@ test('useNativeDriver: JS-side _value is synced before the completion callback f
if (finished) {
// $FlowFixMe[prop-missing] _value is internal but stable for testing.
_valueInCallback = _value._value;
// $FlowFixMe[prop-missing]
_interpolationInCallback = _value
.interpolate({inputRange: [0, 1], outputRange: [0.5, 1]})
.__getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ describe('Animated', () => {
expect(console.warn).toBeCalledWith(
'Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`',
);
// $FlowFixMe[prop-missing]
console.warn.mockRestore();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ describe('AnimatedValue', () => {
original.apply(NativeAnimatedHelper.API, args),
);
// $FlowFixMe[prop-missing]
// $FlowFixMe[cannot-write]
NativeAnimatedHelper.API[name] = spy;
restoreAPI.push(() => {
// $FlowFixMe[prop-missing]
// $FlowFixMe[cannot-write]
NativeAnimatedHelper.API[name] = original;
});
return spy;
Expand Down Expand Up @@ -234,7 +232,6 @@ describe('AnimatedValue', () => {

emitMockUpdate(node, 123, 50);

// $FlowFixMe[method-unbinding]
const original = node.__onAnimatedValueUpdateReceived;
const spy = jest.fn((...args: Array<unknown>) =>
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,8 @@ describe('Interpolation', () => {
outputRange: ['rgba(0, 100, 200, 0)', 'rgba(50, 150, 250, 0.4)'],
});

// $FlowFixMe[incompatible-call]
expect(interpolation(0)).toBe('rgba(0, 100, 200, 0)');
// $FlowFixMe[incompatible-call]
expect(interpolation(0.5)).toBe('rgba(25, 125, 225, 0.2)');
// $FlowFixMe[incompatible-call]
expect(interpolation(1)).toBe('rgba(50, 150, 250, 0.4)');
});

Expand Down Expand Up @@ -447,7 +444,6 @@ describe('Interpolation', () => {
const config = new AnimatedInterpolation(
// $FlowFixMe[incompatible-type]
{},
// $FlowFixMe[incompatible-call]
{inputRange: [0, 1], outputRange},
).__getNativeConfig();
expect(config.outputRange).toEqual(expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export default class DecayAnimation extends Animation {

this._lastValue = value;
if (this.__active) {
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
// $FlowFixMe[invalid-tuple-arity]
this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));
}
Expand Down
Loading
Loading