Skip to content

Commit ea04a48

Browse files
authored
Flow: remove unused suppressions (#25424)
Removes $FlowFixMe's that are no longer needed. Used flow/tool from the Flow repo: ``` ~/Developer/flow/tool update-suppressions . ```
1 parent 9813ede commit ea04a48

Some content is hidden

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

46 files changed

+11
-113
lines changed

packages/react-cache/src/ReactCacheOld.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ function accessResult<I, K, V>(
122122
);
123123
const newResult: PendingResult = {
124124
status: Pending,
125-
// $FlowFixMe[method-unbinding]
126125
value: thenable,
127126
};
128127
// $FlowFixMe[escaped-generic] discovered when updating Flow

packages/react-client/src/ReactFlightClient.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
321321
initializingChunkBlockedModel !== null &&
322322
initializingChunkBlockedModel.deps > 0
323323
) {
324-
// $FlowFixMe[incompatible-type]: found when upgrading Flow
325324
initializingChunkBlockedModel.value = value;
326325
// We discovered new dependencies on modules that are not yet resolved.
327326
// We have to go the BLOCKED state until they're resolved.

packages/react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ function measureStyle(
129129
return;
130130
}
131131

132-
// $FlowFixMe the parameter types of an unknown function are unknown
133132
instance.measure((x, y, width, height, left, top) => {
134133
// RN Android sometimes returns undefined here. Don't send measurements in this case.
135134
// https://github.com/jhen0409/react-native-debugger/issues/84#issuecomment-304611817

packages/react-devtools-shared/src/backend/console.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ export function patch({
181181
unpatchFn = () => {
182182
for (const method in originalConsoleMethods) {
183183
try {
184-
// $FlowFixMe property error|warn is not writable.
185184
targetConsole[method] = originalConsoleMethods[method];
186185
} catch (error) {}
187186
}
@@ -279,7 +278,6 @@ export function patch({
279278
overrideMethod.__REACT_DEVTOOLS_ORIGINAL_METHOD__ = originalMethod;
280279
originalMethod.__REACT_DEVTOOLS_OVERRIDE_METHOD__ = overrideMethod;
281280

282-
// $FlowFixMe property error|warn is not writable.
283281
targetConsole[method] = overrideMethod;
284282
} catch (error) {}
285283
});
@@ -321,7 +319,6 @@ export function patchForStrictMode() {
321319
unpatchForStrictModeFn = () => {
322320
for (const method in originalConsoleMethods) {
323321
try {
324-
// $FlowFixMe property error|warn is not writable.
325322
targetConsole[method] = originalConsoleMethods[method];
326323
} catch (error) {}
327324
}
@@ -355,7 +352,6 @@ export function patchForStrictMode() {
355352
overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
356353
originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
357354

358-
// $FlowFixMe property error|warn is not writable.
359355
targetConsole[method] = overrideMethod;
360356
} catch (error) {}
361357
});

packages/react-devtools-shared/src/backend/profilingHooks.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ let supportsUserTimingV3 = false;
5353
if (supportsUserTiming) {
5454
const CHECK_V3_MARK = '__v3';
5555
const markOptions = {};
56-
// $FlowFixMe: Ignore Flow complaining about needing a value
5756
Object.defineProperty(markOptions, 'startTime', {
5857
get: function() {
5958
supportsUserTimingV3 = true;

packages/react-devtools-shared/src/backend/renderer.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ export function getInternalReactConstants(
387387
const symbolOrNumber =
388388
typeof type === 'object' && type !== null ? type.$$typeof : type;
389389

390-
// $FlowFixMe Flow doesn't know about typeof "symbol"
391390
return typeof symbolOrNumber === 'symbol'
392391
? // $FlowFixMe `toString()` doesn't match the type signature?
393392
symbolOrNumber.toString()
@@ -3275,7 +3274,6 @@ export function attach(
32753274
for (const method in console) {
32763275
try {
32773276
originalConsoleMethods[method] = console[method];
3278-
// $FlowFixMe property error|warn is not writable.
32793277
console[method] = () => {};
32803278
} catch (error) {}
32813279
}
@@ -3290,7 +3288,6 @@ export function attach(
32903288
// Restore original console functionality.
32913289
for (const method in originalConsoleMethods) {
32923290
try {
3293-
// $FlowFixMe property error|warn is not writable.
32943291
console[method] = originalConsoleMethods[method];
32953292
} catch (error) {}
32963293
}
@@ -3713,7 +3710,6 @@ export function attach(
37133710
id,
37143711
responseID: requestID,
37153712
type: 'full-data',
3716-
// $FlowFixMe[incompatible-return] found when upgrading Flow
37173713
// $FlowFixMe[prop-missing] found when upgrading Flow
37183714
value: cleanedInspectedElement,
37193715
};

packages/react-devtools-shared/src/backend/views/Highlighter/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ export default function setupHighlighter(
119119
if (scrollIntoView && typeof node.scrollIntoView === 'function') {
120120
// If the node isn't visible show it before highlighting it.
121121
// We may want to reconsider this; it might be a little disruptive.
122-
// $FlowFixMe Flow only knows about 'start' | 'end'
123122
node.scrollIntoView({block: 'nearest', inline: 'nearest'});
124123
}
125124

packages/react-devtools-shared/src/devtools/cache.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ function accessResult<Input, Key, Value>(
128128
);
129129
const newResult: PendingResult = {
130130
status: Pending,
131-
// $FlowFixMe[method-unbinding]
132131
value: thenable,
133132
};
134133
entriesForResource.set(key, newResult);

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementHooksTree.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ export function InnerHooksTreeView({
138138
inspectedElement,
139139
path,
140140
}: InnerHooksTreeViewProps): React.Node {
141-
// $FlowFixMe "Missing type annotation for U" whatever that means
142141
return hooks.map((hook, index) => (
143142
<HookView
144143
key={index}
@@ -356,7 +355,6 @@ function HookView({
356355
className={name !== '' ? styles.Name : styles.NameAnonymous}>
357356
{hookDisplayName || 'Anonymous'}
358357
</span>{' '}
359-
{/* $FlowFixMe */}
360358
<span className={styles.Value} onClick={toggleIsOpen}>
361359
{displayValue}
362360
</span>

packages/react-devtools-shared/src/devtools/views/Components/Tree.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ export default function Tree(props: Props): React.Node {
409409
tabIndex={0}>
410410
<AutoSizer>
411411
{({height, width}) => (
412-
// $FlowFixMe https://github.com/facebook/flow/issues/7341
413412
<FixedSizeList
414413
className={styles.List}
415414
height={height}

packages/react-devtools-shared/src/hook.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ export function installHook(target: any): DevToolsHook | null {
250250
unpatchFn = () => {
251251
for (const method in originalConsoleMethods) {
252252
try {
253-
// $FlowFixMe property error|warn is not writable.
254253
targetConsole[method] = originalConsoleMethods[method];
255254
} catch (error) {}
256255
}
@@ -302,7 +301,6 @@ export function installHook(target: any): DevToolsHook | null {
302301
overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
303302
originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
304303

305-
// $FlowFixMe property error|warn is not writable.
306304
targetConsole[method] = overrideMethod;
307305
} catch (error) {}
308306
});

packages/react-devtools-shared/src/hooks/parseHookNames/parseSourceAndMetadata.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ function findHookNames(
186186
}
187187

188188
const key = getHookSourceLocationKey(hookSource);
189-
// $FlowFixMe[incompatible-call] found when upgrading Flow
190189
map.set(key, name);
191190
});
192191

packages/react-devtools-shared/src/inspectedElementMutableSource.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export function inspectElement({
137137

138138
// A path has been hydrated.
139139
// Merge it with the latest copy we have locally and resolve with the merged value.
140-
// $FlowFixMe[incompatible-type] found when upgrading Flow
141140
inspectedElement = inspectedElementCache.get(id) || null;
142141
if (inspectedElement !== null) {
143142
// Clone element
@@ -151,7 +150,6 @@ export function inspectElement({
151150
hydrateHelper(value, ((path: any): Path)),
152151
);
153152

154-
// $FlowFixMe[incompatible-call] found when upgrading Flow
155153
inspectedElementCache.set(id, inspectedElement);
156154

157155
return [inspectedElement, type];

packages/react-devtools-shell/src/app/DeeplyNestedComponents/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ function wrapWithHoc(Component, index) {
1515
return <Component />;
1616
}
1717

18-
// $FlowFixMe
1918
const displayName = Component.displayName || Component.name;
2019

2120
// $FlowFixMe[incompatible-type] found when upgrading Flow

packages/react-devtools-shell/src/app/ElementTypes/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
memo,
1616
Component,
1717
Fragment,
18-
// $FlowFixMe Flow doesn't know about the Profiler import yet
1918
Profiler,
2019
StrictMode,
2120
Suspense,

packages/react-devtools-timeline/src/view-base/utils/normalizeWheel.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,11 @@ export function normalizeWheel(event: WheelEvent): NormalizedWheelDelta {
7171
let deltaX = event.deltaX;
7272
let deltaY = event.deltaY;
7373

74-
if (
75-
// $FlowFixMe DOM_DELTA_LINE missing from WheelEvent
76-
event.deltaMode === WheelEvent.DOM_DELTA_LINE
77-
) {
74+
if (event.deltaMode === WheelEvent.DOM_DELTA_LINE) {
7875
// delta in LINE units
7976
deltaX *= LINE_HEIGHT;
8077
deltaY *= LINE_HEIGHT;
81-
} else if (
82-
// $FlowFixMe DOM_DELTA_PAGE missing from WheelEvent
83-
event.deltaMode === WheelEvent.DOM_DELTA_PAGE
84-
) {
78+
} else if (event.deltaMode === WheelEvent.DOM_DELTA_PAGE) {
8579
// delta in PAGE units
8680
deltaX *= PAGE_HEIGHT;
8781
deltaY *= PAGE_HEIGHT;

packages/react-dom-bindings/src/client/ReactDOMComponent.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ export function createElement(
419419
const firstChild = ((div.firstChild: any): HTMLScriptElement);
420420
domElement = div.removeChild(firstChild);
421421
} else if (typeof props.is === 'string') {
422-
// $FlowFixMe `createElement` should be updated for Web Components
423422
domElement = ownerDocument.createElement(type, {is: props.is});
424423
} else {
425424
// Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.

packages/react-dom-bindings/src/events/checkPassiveEvents.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export let passiveBrowserEventsSupported: boolean = false;
1616
if (canUseDOM) {
1717
try {
1818
const options = {};
19-
// $FlowFixMe: Ignore Flow complaining about needing a value
2019
Object.defineProperty(options, 'passive', {
2120
get: function() {
2221
passiveBrowserEventsSupported = true;

packages/react-dom-bindings/src/events/plugins/BeforeInputEventPlugin.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,8 @@ function extractCompositionEvent(
227227
}
228228
}
229229

230-
// $FlowFixMe[incompatible-call] found when upgrading Flow
231230
const listeners = accumulateTwoPhaseListeners(targetInst, eventType);
232231
if (listeners.length > 0) {
233-
// $FlowFixMe[incompatible-type]
234232
const event: ReactSyntheticEvent = new SyntheticCompositionEvent(
235233
eventType,
236234
domEventName,
@@ -403,7 +401,6 @@ function extractBeforeInputEvent(
403401

404402
const listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');
405403
if (listeners.length > 0) {
406-
// $FlowFixMe[incompatible-type]
407404
const event: ReactSyntheticEvent = new SyntheticInputEvent(
408405
'onBeforeInput',
409406
'beforeinput',

packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ function createAndAccumulateChangeEvent(
5959
enqueueStateRestore(((target: any): Node));
6060
const listeners = accumulateTwoPhaseListeners(inst, 'onChange');
6161
if (listeners.length > 0) {
62-
// $FlowFixMe[incompatible-type]
6362
const event: ReactSyntheticEvent = new SyntheticEvent(
6463
'onChange',
6564
'change',

packages/react-dom-bindings/src/events/plugins/EnterLeaveEventPlugin.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ function extractEvents(
104104
const nearestMounted = getNearestMountedFiber(to);
105105
if (
106106
to !== nearestMounted ||
107-
// $FlowFixMe[incompatible-use] found when upgrading Flow
108107
(to.tag !== HostComponent && to.tag !== HostText)
109108
) {
110109
to = null;
@@ -135,8 +134,6 @@ function extractEvents(
135134
const fromNode = from == null ? win : getNodeFromInstance(from);
136135
const toNode = to == null ? win : getNodeFromInstance(to);
137136

138-
// $FlowFixMe[prop-missing]
139-
// $FlowFixMe[incompatible-type]
140137
const leave: KnownReactSyntheticEvent = new SyntheticEventCtor(
141138
leaveEventType,
142139
eventTypePrefix + 'leave',
@@ -153,7 +150,6 @@ function extractEvents(
153150
// the first ancestor. Next time, we will ignore the event.
154151
const nativeTargetInst = getClosestInstanceFromNode((nativeEventTarget: any));
155152
if (nativeTargetInst === targetInst) {
156-
// $FlowFixMe[prop-missing]
157153
const enterEvent: KnownReactSyntheticEvent = new SyntheticEventCtor(
158154
enterEventType,
159155
eventTypePrefix + 'enter',

packages/react-dom-bindings/src/events/plugins/SelectEventPlugin.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
116116
'onSelect',
117117
);
118118
if (listeners.length > 0) {
119-
// $FlowFixMe[incompatible-type]
120119
const event: ReactSyntheticEvent = new SyntheticEvent(
121120
'onSelect',
122121
'select',

packages/react-dom-bindings/src/events/plugins/SimpleEventPlugin.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ function extractEvents(
173173
);
174174
if (listeners.length > 0) {
175175
// Intentionally create event lazily.
176-
// $FlowFixMe[incompatible-type]
177176
const event: ReactSyntheticEvent = new SyntheticEventCtor(
178177
reactName,
179178
reactEventType,
@@ -206,7 +205,6 @@ function extractEvents(
206205
);
207206
if (listeners.length > 0) {
208207
// Intentionally create event lazily.
209-
// $FlowFixMe[incompatible-type]
210208
const event: ReactSyntheticEvent = new SyntheticEventCtor(
211209
reactName,
212210
reactEventType,

packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ function pushAttribute(
511511
// shouldRemoveAttribute
512512
switch (typeof value) {
513513
case 'function':
514-
// $FlowFixMe symbol is perfectly valid here
515514
case 'symbol': // eslint-disable-line
516515
return;
517516
case 'boolean': {
@@ -620,7 +619,6 @@ function pushAttribute(
620619
// shouldRemoveAttribute
621620
switch (typeof value) {
622621
case 'function':
623-
// $FlowFixMe symbol is perfectly valid here
624622
case 'symbol': // eslint-disable-line
625623
return;
626624
case 'boolean': {

packages/react-dom-bindings/src/shared/DOMProperty.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export function shouldRemoveAttributeWithWarning(
123123
}
124124
switch (typeof value) {
125125
case 'function':
126-
// $FlowFixMe symbol is perfectly valid here
127126
case 'symbol': // eslint-disable-line
128127
return true;
129128
case 'boolean': {

packages/react-fs/src/ReactFilesystem.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ export function access(path: string, mode?: number): void {
121121
record = createRecordFromThenable(thenable);
122122
accessCache.push(mode, record);
123123
}
124-
// $FlowFixMe[incompatible-call] found when upgrading Flow
125124
readRecord(record); // No return value.
126125
}
127126

packages/react-reconciler/src/ReactFiberAct.new.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
4040
export function isConcurrentActEnvironment(): void | boolean {
4141
if (__DEV__) {
4242
const isReactActEnvironmentGlobal =
43-
// $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
4443
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
4544
? IS_REACT_ACT_ENVIRONMENT
4645
: undefined;

packages/react-reconciler/src/ReactFiberAct.old.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
4040
export function isConcurrentActEnvironment(): void | boolean {
4141
if (__DEV__) {
4242
const isReactActEnvironmentGlobal =
43-
// $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
4443
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
4544
? IS_REACT_ACT_ENVIRONMENT
4645
: undefined;

packages/react-reconciler/src/ReactFiberCommitWork.new.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ function commitBeforeMutationEffects_begin() {
350350
// Let's skip the whole loop if it's off.
351351
if (enableCreateEventHandleAPI) {
352352
// TODO: Should wrap this in flags check, too, as optimization
353-
// $FlowFixMe[incompatible-use] found when upgrading Flow
354353
const deletions = fiber.deletions;
355354
if (deletions !== null) {
356355
for (let i = 0; i < deletions.length; i++) {
@@ -360,10 +359,8 @@ function commitBeforeMutationEffects_begin() {
360359
}
361360
}
362361

363-
// $FlowFixMe[incompatible-use] found when upgrading Flow
364362
const child = fiber.child;
365363
if (
366-
// $FlowFixMe[incompatible-use] found when upgrading Flow
367364
(fiber.subtreeFlags & BeforeMutationMask) !== NoFlags &&
368365
child !== null
369366
) {

packages/react-reconciler/src/ReactFiberCommitWork.old.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ function commitBeforeMutationEffects_begin() {
350350
// Let's skip the whole loop if it's off.
351351
if (enableCreateEventHandleAPI) {
352352
// TODO: Should wrap this in flags check, too, as optimization
353-
// $FlowFixMe[incompatible-use] found when upgrading Flow
354353
const deletions = fiber.deletions;
355354
if (deletions !== null) {
356355
for (let i = 0; i < deletions.length; i++) {
@@ -360,10 +359,8 @@ function commitBeforeMutationEffects_begin() {
360359
}
361360
}
362361

363-
// $FlowFixMe[incompatible-use] found when upgrading Flow
364362
const child = fiber.child;
365363
if (
366-
// $FlowFixMe[incompatible-use] found when upgrading Flow
367364
(fiber.subtreeFlags & BeforeMutationMask) !== NoFlags &&
368365
child !== null
369366
) {

0 commit comments

Comments
 (0)