Skip to content

Commit bbfd391

Browse files
authored
Remove unused Flow suppressions
Summary: Remove Flow suppression comments that Flow no longer needs, both with the open source Flow configuration and with the internal one. Automated with `flow dev-tools update-suppressions --only remove`, keeping only the comments reported as unused by both configurations. Changelog: [Internal] Differential Revision: D133000126 Pull Request resolved: #60158
1 parent 40c4620 commit bbfd391

213 files changed

Lines changed: 19 additions & 631 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎packages/debugger-shell/src/electron/SettingsStore.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* @oncall react_native
1010
*/
1111

12-
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
1312
const {app} = require('electron') as any;
1413
const fs = require('node:fs');
1514
const path = require('node:path');

‎packages/dev-middleware/src/__tests__/FetchUtils.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export function withFetchSelfSignedCertsForAllTests(
7979
// For some reason, setting the `selfSignedCertDispatcher` with `setGlobalDispatcher` doesn't work.
8080
// Instead of using `setGlobalDispatcher`, we'll use a spy to intercept the fetch calls and add the dispatcher.
8181
fetchSpy.mockImplementation((url, options) =>
82-
// $FlowFixMe[cannot-spread-interface]
8382
fetchOriginal(url, {
8483
...options,
8584
// $FlowFixMe[prop-missing]: dispatcher

‎packages/dev-middleware/src/__tests__/InspectorDebuggerUtils.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export class DebuggerMock extends DebuggerAgent {
111111
: this.handle.mock.calls;
112112
// $FlowFixMe[incompatible-use]
113113
// $FlowFixMe[prop-missing]
114-
// $FlowFixMe[incompatible-type]
115114
const [response] = newHandleCalls.find(args => args[0].id === message.id);
116115
// $FlowFixMe[incompatible-type]
117116
// $FlowFixMe[incompatible-indexer]

‎packages/dev-middleware/src/__tests__/InspectorProtocolUtils.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export async function sendFromTargetToDebugger<
6868
: debugger_.handle.mock.calls;
6969
// $FlowFixMe[incompatible-type]
7070
const [receivedMessage]: [Message] = newHandleCalls.find(
71-
// $FlowFixMe[incompatible-type]
7271
(call: [Message]) => call[0].method === message.method,
7372
);
7473
return receivedMessage;

‎packages/dev-middleware/src/inspector-proxy/Device.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ export default class Device {
500500
});
501501

502502
const cdpDebugLogging = this.#cdpDebugLogging;
503-
// $FlowFixMe[method-unbinding]
504503
const sendFunc = socket.send;
505504
// $FlowFixMe[cannot-write]
506505
socket.send = function (message: string) {
@@ -1156,7 +1155,6 @@ export default class Device {
11561155
// Fetch text, raising an exception if the text could not be fetched,
11571156
// or is too large.
11581157
async #fetchText(url: URL): Promise<string> {
1159-
// $FlowFixMe[incompatible-call] Suppress arvr node-fetch flow error
11601158
const response = await fetch(url);
11611159
if (!response.ok) {
11621160
throw new Error('HTTP ' + response.status + ' ' + response.statusText);

‎packages/dev-middleware/src/inspector-proxy/EventLoopPerfTracker.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* @format
99
*/
1010

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

1413
import {monitorEventLoopDelay, performance} from 'node:perf_hooks';

‎packages/dev-middleware/src/inspector-proxy/InspectorProxy.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ export default class InspectorProxy implements InspectorProxyQueries {
333333
// well-behaved and the debugger is prepared to handle large messages.
334334
maxPayload: 0,
335335
});
336-
// $FlowFixMe[value-as-type]
337336
wss.on('connection', async (socket: WS, req) => {
338337
const wssTimestamp = Date.now();
339338

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

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

‎packages/jest-preset/jest/mockComponent.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function mockComponent<
2727
moduleName: string,
2828
instanceMethods: ?interface {},
2929
isESModule: TIsESModule,
30-
): TIsESModule extends true // $FlowFixMe[incompatible-use]
30+
): TIsESModule extends true
3131
? ModuleDefault<TComponentModule & typeof instanceMethods>
3232
: TComponentModule & typeof instanceMethods {
3333
const RealComponent: TComponentType = isESModule

‎packages/jest-preset/jest/setup.js‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ Object.defineProperties(global, {
4343
configurable: true,
4444
enumerable: true,
4545
value: {
46-
// $FlowFixMe[method-unbinding]
47-
// $FlowFixMe[incompatible-type]
4846
now: jest.fn(Date.now),
4947
},
5048
writable: true,
@@ -177,7 +175,6 @@ mock(
177175
mock(
178176
// $FlowFixMe[cannot-resolve-module]
179177
'm#react-native/Libraries/ReactNative/RendererProxy',
180-
// $FlowFixMe[incompatible-type] - `./mocks/RendererProxy` is incomplete.
181178
'm#./mocks/RendererProxy',
182179
);
183180
mock(

‎packages/polyfills/__tests__/consoleTable-itest.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ describe('console.table(data, rows)', () => {
233233
{third: 7, fourth: 8},
234234
{fifth: 9},
235235
],
236-
// $FlowExpectedError[extra-arg]
237236
['first', 'fifth'],
238237
);
239238
expect(logFn).toHaveBeenCalledTimes(1);
@@ -257,7 +256,6 @@ describe('console.table(data, rows)', () => {
257256
c: {third: 7, fourth: 8},
258257
d: {fifth: 9},
259258
},
260-
// $FlowExpectedError[extra-arg]
261259
['first', 'fifth'],
262260
);
263261
expect(logFn).toHaveBeenCalledTimes(1);

0 commit comments

Comments
 (0)