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 . ```
Jan Kassens committed
Oct 4, 2022 at 16:18 UTC
ea04a486a7c27771f7eea896565c0980927ed3b4
46 files changed
+11
-113
packages/react-cache/src/ReactCacheOld.js
-1
@@ -122,7 +122,6 @@ function accessResult<I, K, V>(
122
);
123
const newResult: PendingResult = {
124
status: Pending,
125
- // $FlowFixMe[method-unbinding]
125
value: thenable,
126
};
127
// $FlowFixMe[escaped-generic] discovered when updating Flow
packages/react-client/src/ReactFlightClient.js
-1
@@ -321,7 +321,6 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
321
initializingChunkBlockedModel !== null &&
322
initializingChunkBlockedModel.deps > 0
323
) {
324
- // $FlowFixMe[incompatible-type]: found when upgrading Flow
324
initializingChunkBlockedModel.value = value;
325
// We discovered new dependencies on modules that are not yet resolved.
326
// We have to go the BLOCKED state until they're resolved.
packages/react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor.js
-1
@@ -129,7 +129,6 @@ function measureStyle(
129
return;
130
}
131
132
- // $FlowFixMe the parameter types of an unknown function are unknown
132
instance.measure((x, y, width, height, left, top) => {
133
// RN Android sometimes returns undefined here. Don't send measurements in this case.
134
// https://github.com/jhen0409/react-native-debugger/issues/84#issuecomment-304611817
packages/react-devtools-shared/src/backend/console.js
-4
@@ -181,7 +181,6 @@ export function patch({
181
unpatchFn = () => {
182
for (const method in originalConsoleMethods) {
183
try {
184
- // $FlowFixMe property error|warn is not writable.
184
targetConsole[method] = originalConsoleMethods[method];
185
} catch (error) {}
186
}
@@ -279,7 +278,6 @@ export function patch({
278
overrideMethod.__REACT_DEVTOOLS_ORIGINAL_METHOD__ = originalMethod;
279
originalMethod.__REACT_DEVTOOLS_OVERRIDE_METHOD__ = overrideMethod;
280
282
- // $FlowFixMe property error|warn is not writable.
281
targetConsole[method] = overrideMethod;
282
} catch (error) {}
283
});
@@ -321,7 +319,6 @@ export function patchForStrictMode() {
319
unpatchForStrictModeFn = () => {
320
for (const method in originalConsoleMethods) {
321
try {
324
- // $FlowFixMe property error|warn is not writable.
322
targetConsole[method] = originalConsoleMethods[method];
323
} catch (error) {}
324
}
@@ -355,7 +352,6 @@ export function patchForStrictMode() {
352
overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
353
originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
354
358
- // $FlowFixMe property error|warn is not writable.
355
targetConsole[method] = overrideMethod;
356
} catch (error) {}
357
});
packages/react-devtools-shared/src/backend/profilingHooks.js
-1
@@ -53,7 +53,6 @@ let supportsUserTimingV3 = false;
53
if (supportsUserTiming) {
54
const CHECK_V3_MARK = '__v3';
55
const markOptions = {};
56
- // $FlowFixMe: Ignore Flow complaining about needing a value
56
Object.defineProperty(markOptions, 'startTime', {
57
get: function() {
58
supportsUserTimingV3 = true;
packages/react-devtools-shared/src/backend/renderer.js
-4
@@ -387,7 +387,6 @@ export function getInternalReactConstants(
387
const symbolOrNumber =
388
typeof type === 'object' && type !== null ? type.$$typeof : type;
389
390
- // $FlowFixMe Flow doesn't know about typeof "symbol"
390
return typeof symbolOrNumber === 'symbol'
391
? // $FlowFixMe `toString()` doesn't match the type signature?
392
symbolOrNumber.toString()
@@ -3275,7 +3274,6 @@ export function attach(
3274
for (const method in console) {
3275
try {
3276
originalConsoleMethods[method] = console[method];
3278
- // $FlowFixMe property error|warn is not writable.
3277
console[method] = () => {};
3278
} catch (error) {}
3279
}
@@ -3290,7 +3288,6 @@ export function attach(
3288
// Restore original console functionality.
3289
for (const method in originalConsoleMethods) {
3290
try {
3293
- // $FlowFixMe property error|warn is not writable.
3291
console[method] = originalConsoleMethods[method];
3292
} catch (error) {}
3293
}
@@ -3713,7 +3710,6 @@ export function attach(
3710
id,
3711
responseID: requestID,
3712
type: 'full-data',
3716
- // $FlowFixMe[incompatible-return] found when upgrading Flow
3713
// $FlowFixMe[prop-missing] found when upgrading Flow
3714
value: cleanedInspectedElement,
3715
};
packages/react-devtools-shared/src/backend/views/Highlighter/index.js
-1
@@ -119,7 +119,6 @@ export default function setupHighlighter(
119
if (scrollIntoView && typeof node.scrollIntoView === 'function') {
120
// If the node isn't visible show it before highlighting it.
121
// We may want to reconsider this; it might be a little disruptive.
122
- // $FlowFixMe Flow only knows about 'start' | 'end'
122
node.scrollIntoView({block: 'nearest', inline: 'nearest'});
123
}
124
packages/react-devtools-shared/src/devtools/cache.js
-1
@@ -128,7 +128,6 @@ function accessResult<Input, Key, Value>(
128
);
129
const newResult: PendingResult = {
130
status: Pending,
131
- // $FlowFixMe[method-unbinding]
131
value: thenable,
132
};
133
entriesForResource.set(key, newResult);
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementHooksTree.js
-2
@@ -138,7 +138,6 @@ export function InnerHooksTreeView({
138
inspectedElement,
139
path,
140
}: InnerHooksTreeViewProps): React.Node {
141
- // $FlowFixMe "Missing type annotation for U" whatever that means
141
return hooks.map((hook, index) => (
142
<HookView
143
key={index}
@@ -356,7 +355,6 @@ function HookView({
355
className={name !== '' ? styles.Name : styles.NameAnonymous}>
356
{hookDisplayName || 'Anonymous'}
357
</span>{' '}
359
- {/* $FlowFixMe */}
358
<span className={styles.Value} onClick={toggleIsOpen}>
359
{displayValue}
360
</span>
packages/react-devtools-shared/src/devtools/views/Components/Tree.js
-1
@@ -409,7 +409,6 @@ export default function Tree(props: Props): React.Node {
409
tabIndex={0}>
410
<AutoSizer>
411
{({height, width}) => (
412
- // $FlowFixMe https://github.com/facebook/flow/issues/7341
412
<FixedSizeList
413
className={styles.List}
414
height={height}
packages/react-devtools-shared/src/hook.js
-2
@@ -250,7 +250,6 @@ export function installHook(target: any): DevToolsHook | null {
250
unpatchFn = () => {
251
for (const method in originalConsoleMethods) {
252
try {
253
- // $FlowFixMe property error|warn is not writable.
253
targetConsole[method] = originalConsoleMethods[method];
254
} catch (error) {}
255
}
@@ -302,7 +301,6 @@ export function installHook(target: any): DevToolsHook | null {
301
overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
302
originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
303
305
- // $FlowFixMe property error|warn is not writable.
304
targetConsole[method] = overrideMethod;
305
} catch (error) {}
306
});
packages/react-devtools-shared/src/hooks/parseHookNames/parseSourceAndMetadata.js
-1
@@ -186,7 +186,6 @@ function findHookNames(
186
}
187
188
const key = getHookSourceLocationKey(hookSource);
189
- // $FlowFixMe[incompatible-call] found when upgrading Flow
189
map.set(key, name);
190
});
191
packages/react-devtools-shared/src/inspectedElementMutableSource.js
-2
@@ -137,7 +137,6 @@ export function inspectElement({
137
138
// A path has been hydrated.
139
// Merge it with the latest copy we have locally and resolve with the merged value.
140
- // $FlowFixMe[incompatible-type] found when upgrading Flow
140
inspectedElement = inspectedElementCache.get(id) || null;
141
if (inspectedElement !== null) {
142
// Clone element
@@ -151,7 +150,6 @@ export function inspectElement({
150
hydrateHelper(value, ((path: any): Path)),
151
);
152
154
- // $FlowFixMe[incompatible-call] found when upgrading Flow
153
inspectedElementCache.set(id, inspectedElement);
154
155
return [inspectedElement, type];
packages/react-devtools-shell/src/app/DeeplyNestedComponents/index.js
-1
@@ -15,7 +15,6 @@ function wrapWithHoc(Component, index) {
15
return <Component />;
16
}
17
18
- // $FlowFixMe
18
const displayName = Component.displayName || Component.name;
19
20
// $FlowFixMe[incompatible-type] found when upgrading Flow
packages/react-devtools-shell/src/app/ElementTypes/index.js
-1
@@ -15,7 +15,6 @@ import {
15
memo,
16
Component,
17
Fragment,
18
- // $FlowFixMe Flow doesn't know about the Profiler import yet
18
Profiler,
19
StrictMode,
20
Suspense,
packages/react-devtools-timeline/src/view-base/utils/normalizeWheel.js
+2
-8
@@ -71,17 +71,11 @@ export function normalizeWheel(event: WheelEvent): NormalizedWheelDelta {
71
let deltaX = event.deltaX;
72
let deltaY = event.deltaY;
73
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) {
75
// delta in LINE units
76
deltaX *= LINE_HEIGHT;
77
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) {
79
// delta in PAGE units
80
deltaX *= PAGE_HEIGHT;
81
deltaY *= PAGE_HEIGHT;
packages/react-dom-bindings/src/client/ReactDOMComponent.js
-1
@@ -419,7 +419,6 @@ export function createElement(
419
const firstChild = ((div.firstChild: any): HTMLScriptElement);
420
domElement = div.removeChild(firstChild);
421
} else if (typeof props.is === 'string') {
422
- // $FlowFixMe `createElement` should be updated for Web Components
422
domElement = ownerDocument.createElement(type, {is: props.is});
423
} else {
424
// Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
packages/react-dom-bindings/src/events/checkPassiveEvents.js
-1
@@ -16,7 +16,6 @@ export let passiveBrowserEventsSupported: boolean = false;
16
if (canUseDOM) {
17
try {
18
const options = {};
19
- // $FlowFixMe: Ignore Flow complaining about needing a value
19
Object.defineProperty(options, 'passive', {
20
get: function() {
21
passiveBrowserEventsSupported = true;
packages/react-dom-bindings/src/events/plugins/BeforeInputEventPlugin.js
-3
@@ -227,10 +227,8 @@ function extractCompositionEvent(
227
}
228
}
229
230
- // $FlowFixMe[incompatible-call] found when upgrading Flow
230
const listeners = accumulateTwoPhaseListeners(targetInst, eventType);
231
if (listeners.length > 0) {
233
- // $FlowFixMe[incompatible-type]
232
const event: ReactSyntheticEvent = new SyntheticCompositionEvent(
233
eventType,
234
domEventName,
@@ -403,7 +401,6 @@ function extractBeforeInputEvent(
401
402
const listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');
403
if (listeners.length > 0) {
406
- // $FlowFixMe[incompatible-type]
404
const event: ReactSyntheticEvent = new SyntheticInputEvent(
405
'onBeforeInput',
406
'beforeinput',
packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js
-1
@@ -59,7 +59,6 @@ function createAndAccumulateChangeEvent(
59
enqueueStateRestore(((target: any): Node));
60
const listeners = accumulateTwoPhaseListeners(inst, 'onChange');
61
if (listeners.length > 0) {
62
- // $FlowFixMe[incompatible-type]
62
const event: ReactSyntheticEvent = new SyntheticEvent(
63
'onChange',
64
'change',
packages/react-dom-bindings/src/events/plugins/EnterLeaveEventPlugin.js
-4
@@ -104,7 +104,6 @@ function extractEvents(
104
const nearestMounted = getNearestMountedFiber(to);
105
if (
106
to !== nearestMounted ||
107
- // $FlowFixMe[incompatible-use] found when upgrading Flow
107
(to.tag !== HostComponent && to.tag !== HostText)
108
) {
109
to = null;
@@ -135,8 +134,6 @@ function extractEvents(
134
const fromNode = from == null ? win : getNodeFromInstance(from);
135
const toNode = to == null ? win : getNodeFromInstance(to);
136
138
- // $FlowFixMe[prop-missing]
139
- // $FlowFixMe[incompatible-type]
137
const leave: KnownReactSyntheticEvent = new SyntheticEventCtor(
138
leaveEventType,
139
eventTypePrefix + 'leave',
@@ -153,7 +150,6 @@ function extractEvents(
150
// the first ancestor. Next time, we will ignore the event.
151
const nativeTargetInst = getClosestInstanceFromNode((nativeEventTarget: any));
152
if (nativeTargetInst === targetInst) {
156
- // $FlowFixMe[prop-missing]
153
const enterEvent: KnownReactSyntheticEvent = new SyntheticEventCtor(
154
enterEventType,
155
eventTypePrefix + 'enter',
packages/react-dom-bindings/src/events/plugins/SelectEventPlugin.js
-1
@@ -116,7 +116,6 @@ function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {
116
'onSelect',
117
);
118
if (listeners.length > 0) {
119
- // $FlowFixMe[incompatible-type]
119
const event: ReactSyntheticEvent = new SyntheticEvent(
120
'onSelect',
121
'select',
packages/react-dom-bindings/src/events/plugins/SimpleEventPlugin.js
-2
@@ -173,7 +173,6 @@ function extractEvents(
173
);
174
if (listeners.length > 0) {
175
// Intentionally create event lazily.
176
- // $FlowFixMe[incompatible-type]
176
const event: ReactSyntheticEvent = new SyntheticEventCtor(
177
reactName,
178
reactEventType,
@@ -206,7 +205,6 @@ function extractEvents(
205
);
206
if (listeners.length > 0) {
207
// Intentionally create event lazily.
209
- // $FlowFixMe[incompatible-type]
208
const event: ReactSyntheticEvent = new SyntheticEventCtor(
209
reactName,
210
reactEventType,
packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js
-2
@@ -511,7 +511,6 @@ function pushAttribute(
511
// shouldRemoveAttribute
512
switch (typeof value) {
513
case 'function':
514
- // $FlowFixMe symbol is perfectly valid here
514
case 'symbol': // eslint-disable-line
515
return;
516
case 'boolean': {
@@ -620,7 +619,6 @@ function pushAttribute(
619
// shouldRemoveAttribute
620
switch (typeof value) {
621
case 'function':
623
- // $FlowFixMe symbol is perfectly valid here
622
case 'symbol': // eslint-disable-line
623
return;
624
case 'boolean': {
packages/react-dom-bindings/src/shared/DOMProperty.js
-1
@@ -123,7 +123,6 @@ export function shouldRemoveAttributeWithWarning(
123
}
124
switch (typeof value) {
125
case 'function':
126
- // $FlowFixMe symbol is perfectly valid here
126
case 'symbol': // eslint-disable-line
127
return true;
128
case 'boolean': {
packages/react-fs/src/ReactFilesystem.js
-1
@@ -121,7 +121,6 @@ export function access(path: string, mode?: number): void {
121
record = createRecordFromThenable(thenable);
122
accessCache.push(mode, record);
123
}
124
- // $FlowFixMe[incompatible-call] found when upgrading Flow
124
readRecord(record); // No return value.
125
}
126
packages/react-reconciler/src/ReactFiberAct.new.js
-1
@@ -40,7 +40,6 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
40
export function isConcurrentActEnvironment(): void | boolean {
41
if (__DEV__) {
42
const isReactActEnvironmentGlobal =
43
- // $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
43
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
44
? IS_REACT_ACT_ENVIRONMENT
45
: undefined;
packages/react-reconciler/src/ReactFiberAct.old.js
-1
@@ -40,7 +40,6 @@ export function isLegacyActEnvironment(fiber: Fiber): boolean {
40
export function isConcurrentActEnvironment(): void | boolean {
41
if (__DEV__) {
42
const isReactActEnvironmentGlobal =
43
- // $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
43
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
44
? IS_REACT_ACT_ENVIRONMENT
45
: undefined;
packages/react-reconciler/src/ReactFiberCommitWork.new.js
-3
@@ -350,7 +350,6 @@ function commitBeforeMutationEffects_begin() {
350
// Let's skip the whole loop if it's off.
351
if (enableCreateEventHandleAPI) {
352
// TODO: Should wrap this in flags check, too, as optimization
353
- // $FlowFixMe[incompatible-use] found when upgrading Flow
353
const deletions = fiber.deletions;
354
if (deletions !== null) {
355
for (let i = 0; i < deletions.length; i++) {
@@ -360,10 +359,8 @@ function commitBeforeMutationEffects_begin() {
359
}
360
}
361
363
- // $FlowFixMe[incompatible-use] found when upgrading Flow
362
const child = fiber.child;
363
if (
366
- // $FlowFixMe[incompatible-use] found when upgrading Flow
364
(fiber.subtreeFlags & BeforeMutationMask) !== NoFlags &&
365
child !== null
366
) {
packages/react-reconciler/src/ReactFiberCommitWork.old.js
-3
@@ -350,7 +350,6 @@ function commitBeforeMutationEffects_begin() {
350
// Let's skip the whole loop if it's off.
351
if (enableCreateEventHandleAPI) {
352
// TODO: Should wrap this in flags check, too, as optimization
353
- // $FlowFixMe[incompatible-use] found when upgrading Flow
353
const deletions = fiber.deletions;
354
if (deletions !== null) {
355
for (let i = 0; i < deletions.length; i++) {
@@ -360,10 +359,8 @@ function commitBeforeMutationEffects_begin() {
359
}
360
}
361
363
- // $FlowFixMe[incompatible-use] found when upgrading Flow
362
const child = fiber.child;
363
if (
366
- // $FlowFixMe[incompatible-use] found when upgrading Flow
364
(fiber.subtreeFlags & BeforeMutationMask) !== NoFlags &&
365
child !== null
366
) {
packages/react-reconciler/src/ReactFiberCompleteWork.new.js
-2
@@ -357,7 +357,6 @@ if (supportsMutation) {
357
node = node.child;
358
continue;
359
}
360
- // $FlowFixMe This is correct but Flow is confused by the labeled break.
360
node = (node: Fiber);
361
if (node === workInProgress) {
362
return;
@@ -425,7 +424,6 @@ if (supportsMutation) {
424
node = node.child;
425
continue;
426
}
428
- // $FlowFixMe This is correct but Flow is confused by the labeled break.
427
node = (node: Fiber);
428
if (node === workInProgress) {
429
return;
packages/react-reconciler/src/ReactFiberCompleteWork.old.js
-2
@@ -357,7 +357,6 @@ if (supportsMutation) {
357
node = node.child;
358
continue;
359
}
360
- // $FlowFixMe This is correct but Flow is confused by the labeled break.
360
node = (node: Fiber);
361
if (node === workInProgress) {
362
return;
@@ -425,7 +424,6 @@ if (supportsMutation) {
424
node = node.child;
425
continue;
426
}
428
- // $FlowFixMe This is correct but Flow is confused by the labeled break.
427
node = (node: Fiber);
428
if (node === workInProgress) {
429
return;
packages/react-reconciler/src/ReactFiberHooks.new.js
-1
@@ -771,7 +771,6 @@ if (enableUseMemoCacheHook) {
771
function use<T>(usable: Usable<T>): T {
772
if (usable !== null && typeof usable === 'object') {
773
// $FlowFixMe[method-unbinding]
774
- // $FlowFixMe[prop-missing]
774
if (typeof usable.then === 'function') {
775
// This is a thenable.
776
const thenable: Thenable<T> = (usable: any);
packages/react-reconciler/src/ReactFiberHooks.old.js
-1
@@ -771,7 +771,6 @@ if (enableUseMemoCacheHook) {
771
function use<T>(usable: Usable<T>): T {
772
if (usable !== null && typeof usable === 'object') {
773
// $FlowFixMe[method-unbinding]
774
- // $FlowFixMe[prop-missing]
774
if (typeof usable.then === 'function') {
775
// This is a thenable.
776
const thenable: Thenable<T> = (usable: any);
packages/react-reconciler/src/ReactFiberHotReloading.new.js
-2
@@ -51,7 +51,6 @@ import {
51
import {enableFloat} from 'shared/ReactFeatureFlags';
52
53
let resolveFamily: RefreshHandler | null = null;
54
-// $FlowFixMe Flow gets confused by a WeakSet feature check below.
54
let failedBoundaries: WeakSet<Fiber> | null = null;
55
56
export const setRefreshHandler = (handler: RefreshHandler | null): void => {
@@ -212,7 +211,6 @@ export function markFailedErrorBoundaryForHotReloading(fiber: Fiber) {
211
return;
212
}
213
if (failedBoundaries === null) {
215
- // $FlowFixMe Flow got confused by the feature check above.
214
failedBoundaries = new WeakSet();
215
}
216
failedBoundaries.add(fiber);
packages/react-reconciler/src/ReactFiberHotReloading.old.js
-2
@@ -51,7 +51,6 @@ import {
51
import {enableFloat} from 'shared/ReactFeatureFlags';
52
53
let resolveFamily: RefreshHandler | null = null;
54
-// $FlowFixMe Flow gets confused by a WeakSet feature check below.
54
let failedBoundaries: WeakSet<Fiber> | null = null;
55
56
export const setRefreshHandler = (handler: RefreshHandler | null): void => {
@@ -212,7 +211,6 @@ export function markFailedErrorBoundaryForHotReloading(fiber: Fiber) {
211
return;
212
}
213
if (failedBoundaries === null) {
215
- // $FlowFixMe Flow got confused by the feature check above.
214
failedBoundaries = new WeakSet();
215
}
216
failedBoundaries.add(fiber);
packages/react-reconciler/src/ReactFiberWorkLoop.new.js
+1
-12
@@ -415,8 +415,6 @@ export function addMarkerProgressCallbackToPendingTransition(
415
}
416
417
if (currentPendingTransitionCallbacks.markerProgress === null) {
418
- // $FlowFixMe[incompatible-use]
419
- // $FlowFixMe[incompatible-type]
418
currentPendingTransitionCallbacks.markerProgress = new Map();
419
}
420
@@ -445,8 +443,6 @@ export function addMarkerIncompleteCallbackToPendingTransition(
443
}
444
445
if (currentPendingTransitionCallbacks.markerIncomplete === null) {
448
- // $FlowFixMe[incompatible-use] found when upgrading Flow
449
- // $FlowFixMe[incompatible-type] found when upgrading Flow
446
currentPendingTransitionCallbacks.markerIncomplete = new Map();
447
}
448
@@ -474,8 +470,6 @@ export function addMarkerCompleteCallbackToPendingTransition(
470
}
471
472
if (currentPendingTransitionCallbacks.markerComplete === null) {
477
- // $FlowFixMe[incompatible-use] found when upgrading Flow
478
- // $FlowFixMe[incompatible-type] found when upgrading Flow
473
currentPendingTransitionCallbacks.markerComplete = new Map();
474
}
475
@@ -503,8 +497,6 @@ export function addTransitionProgressCallbackToPendingTransition(
497
}
498
499
if (currentPendingTransitionCallbacks.transitionProgress === null) {
506
- // $FlowFixMe[incompatible-use] found when upgrading Flow
507
- // $FlowFixMe[incompatible-type] found when upgrading Flow
500
currentPendingTransitionCallbacks.transitionProgress = new Map();
501
}
502
@@ -1680,8 +1672,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
1672
if (workInProgress !== null) {
1673
let interruptedWork = workInProgressIsSuspended
1674
? workInProgress
1683
- : // $FlowFixMe[incompatible-use] found when upgrading Flow
1684
- workInProgress.return;
1675
+ : workInProgress.return;
1676
while (interruptedWork !== null) {
1677
const current = interruptedWork.alternate;
1678
unwindInterruptedWork(
@@ -3065,12 +3056,10 @@ export function attachPingListener(
3056
pingCache.set(wakeable, threadIDs);
3057
}
3058
}
3068
- // $FlowFixMe[incompatible-use] found when upgrading Flow
3059
if (!threadIDs.has(lanes)) {
3060
workInProgressRootDidAttachPingListener = true;
3061
3062
// Memoize using the thread ID to prevent redundant listeners.
3073
- // $FlowFixMe[incompatible-use] found when upgrading Flow
3063
threadIDs.add(lanes);
3064
const ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);
3065
if (enableUpdaterTracking) {
packages/react-reconciler/src/ReactFiberWorkLoop.old.js
+1
-12
@@ -415,8 +415,6 @@ export function addMarkerProgressCallbackToPendingTransition(
415
}
416
417
if (currentPendingTransitionCallbacks.markerProgress === null) {
418
- // $FlowFixMe[incompatible-use]
419
- // $FlowFixMe[incompatible-type]
418
currentPendingTransitionCallbacks.markerProgress = new Map();
419
}
420
@@ -445,8 +443,6 @@ export function addMarkerIncompleteCallbackToPendingTransition(
443
}
444
445
if (currentPendingTransitionCallbacks.markerIncomplete === null) {
448
- // $FlowFixMe[incompatible-use] found when upgrading Flow
449
- // $FlowFixMe[incompatible-type] found when upgrading Flow
446
currentPendingTransitionCallbacks.markerIncomplete = new Map();
447
}
448
@@ -474,8 +470,6 @@ export function addMarkerCompleteCallbackToPendingTransition(
470
}
471
472
if (currentPendingTransitionCallbacks.markerComplete === null) {
477
- // $FlowFixMe[incompatible-use] found when upgrading Flow
478
- // $FlowFixMe[incompatible-type] found when upgrading Flow
473
currentPendingTransitionCallbacks.markerComplete = new Map();
474
}
475
@@ -503,8 +497,6 @@ export function addTransitionProgressCallbackToPendingTransition(
497
}
498
499
if (currentPendingTransitionCallbacks.transitionProgress === null) {
506
- // $FlowFixMe[incompatible-use] found when upgrading Flow
507
- // $FlowFixMe[incompatible-type] found when upgrading Flow
500
currentPendingTransitionCallbacks.transitionProgress = new Map();
501
}
502
@@ -1680,8 +1672,7 @@ function prepareFreshStack(root: FiberRoot, lanes: Lanes): Fiber {
1672
if (workInProgress !== null) {
1673
let interruptedWork = workInProgressIsSuspended
1674
? workInProgress
1683
- : // $FlowFixMe[incompatible-use] found when upgrading Flow
1684
- workInProgress.return;
1675
+ : workInProgress.return;
1676
while (interruptedWork !== null) {
1677
const current = interruptedWork.alternate;
1678
unwindInterruptedWork(
@@ -3065,12 +3056,10 @@ export function attachPingListener(
3056
pingCache.set(wakeable, threadIDs);
3057
}
3058
}
3068
- // $FlowFixMe[incompatible-use] found when upgrading Flow
3059
if (!threadIDs.has(lanes)) {
3060
workInProgressRootDidAttachPingListener = true;
3061
3062
// Memoize using the thread ID to prevent redundant listeners.
3073
- // $FlowFixMe[incompatible-use] found when upgrading Flow
3063
threadIDs.add(lanes);
3064
const ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);
3065
if (enableUpdaterTracking) {
packages/react-refresh/src/ReactFreshRuntime.js
+7
-7
@@ -47,15 +47,16 @@ const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
47
// We never remove these associations.
48
// It's OK to reference families, but use WeakMap/Set for types.
49
const allFamiliesByID: Map<string, Family> = new Map();
50
-const allFamiliesByType: // $FlowFixMe
51
-WeakMap<any, Family> | Map<any, Family> = new PossiblyWeakMap();
50
+const allFamiliesByType:
51
+ | WeakMap<any, Family>
52
+ | Map<any, Family> = new PossiblyWeakMap();
53
const allSignaturesByType: // $FlowFixMe
54
WeakMap<any, Signature> | Map<any, Signature> = new PossiblyWeakMap();
55
// This WeakMap is read by React, so we only put families
56
// that have actually been edited here. This keeps checks fast.
56
-// $FlowFixMe
57
-const updatedFamiliesByType: // $FlowFixMe
58
-WeakMap<any, Family> | Map<any, Family> = new PossiblyWeakMap();
57
+const updatedFamiliesByType:
58
+ | WeakMap<any, Family>
59
+ | Map<any, Family> = new PossiblyWeakMap();
60
61
// This is cleared on every performReactRefresh() call.
62
// It is an array of [Family, NextType] tuples.
@@ -74,8 +75,7 @@ const failedRoots: Set<FiberRoot> = new Set();
75
// In environments that support WeakMap, we also remember the last element for every root.
76
// It needs to be weak because we do this even for roots that failed to mount.
77
// If there is no WeakMap, we won't attempt to do retrying.
77
-// $FlowFixMe
78
-const rootElements: WeakMap<any, ReactNodeList> | null = // $FlowFixMe
78
+const rootElements: WeakMap<any, ReactNodeList> | null =
79
typeof WeakMap === 'function' ? new WeakMap() : null;
80
81
let isPerformingRefresh = false;
packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js
-1
@@ -9,7 +9,6 @@
9
10
const url = require('url');
11
12
-// $FlowFixMe
12
const Module = require('module');
13
14
module.exports = function register() {
packages/react-server/src/ReactFizzHooks.js
-3
@@ -184,7 +184,6 @@ function createWorkInProgressHook(): Hook {
184
if (workInProgressHook.next === null) {
185
isReRender = false;
186
// Append to the end of the list
187
- // $FlowFixMe[incompatible-use] found when upgrading Flow
187
workInProgressHook = workInProgressHook.next = createHook();
188
} else {
189
// There's already a work-in-progress. Reuse it.
@@ -529,7 +528,6 @@ function throwOnUseEventCall() {
528
export function useEvent<Args, Return, F: (...Array<Args>) => Return>(
529
callback: F,
530
): EventFunctionWrapper<Args, Return, F> {
532
- // $FlowIgnore[incompatible-return] useEvent doesn't work in Fizz
531
return throwOnUseEventCall;
532
}
533
@@ -594,7 +592,6 @@ function useId(): string {
592
function use<T>(usable: Usable<T>): T {
593
if (usable !== null && typeof usable === 'object') {
594
// $FlowFixMe[method-unbinding]
597
- // $FlowFixMe[prop-missing]
595
if (typeof usable.then === 'function') {
596
// This is a thenable.
597
const thenable: Thenable<T> = (usable: any);
packages/react-server/src/ReactFlightHooks.js
-1
@@ -146,7 +146,6 @@ function useId(): string {
146
function use<T>(usable: Usable<T>): T {
147
if (usable !== null && typeof usable === 'object') {
148
// $FlowFixMe[method-unbinding]
149
- // $FlowFixMe[prop-missing]
149
if (typeof usable.then === 'function') {
150
// This is a thenable.
151
const thenable: Thenable<T> = (usable: any);
packages/react-server/src/ReactFlightServer.js
-3
@@ -273,7 +273,6 @@ function attemptResolveElement(
273
);
274
}
275
}
276
- // $FlowFixMe issue discovered when updating Flow
276
return [
277
REACT_ELEMENT_TYPE,
278
type,
@@ -768,7 +767,6 @@ export function resolveModelToJSON(
767
// $FlowFixMe `description` might be undefined
768
const name: string = value.description;
769
771
- // $FlowFixMe `name` might be undefined
770
if (Symbol.for(name) !== value) {
771
throw new Error(
772
'Only global symbols received from Symbol.for(...) can be passed to client components. ' +
@@ -898,7 +896,6 @@ function emitModuleChunk(
896
id: number,
897
moduleMetaData: ModuleMetaData,
898
): void {
901
- // $FlowFixMe ModuleMetaData is not a ReactModel
899
const processedChunk = processModuleChunk(request, id, moduleMetaData);
900
request.completedModuleChunks.push(processedChunk);
901
}
packages/react-server/src/ReactFlightServerConfigStream.js
-2
@@ -121,7 +121,6 @@ export function processModelChunk(
121
id: number,
122
model: ReactModel,
123
): Chunk {
124
- // $FlowFixMe: `json` might be `undefined` when model is a symbol.
124
const json: string = stringify(model, request.toJSON);
125
const row = serializeRowHeader('J', id) + json + '\n';
126
return stringToChunk(row);
@@ -142,7 +141,6 @@ export function processModuleChunk(
141
id: number,
142
moduleMetaData: ReactModel,
143
): Chunk {
145
- // $FlowFixMe: `json` might be `undefined` when moduleMetaData is a symbol.
144
const json: string = stringify(moduleMetaData);
145
const row = serializeRowHeader('M', id) + json + '\n';
146
return stringToChunk(row);
packages/react/src/ReactStartTransition.js
-2
@@ -20,7 +20,6 @@ export function startTransition(
20
const currentTransition = ReactCurrentBatchConfig.transition;
21
22
if (__DEV__) {
23
- // $FlowFixMe[incompatible-use] found when upgrading Flow
23
ReactCurrentBatchConfig.transition._updatedFibers = new Set();
24
}
25
@@ -48,7 +47,6 @@ export function startTransition(
47
'Otherwise concurrent mode guarantees are off the table.',
48
);
49
}
51
- // $FlowFixMe[incompatible-use] found when upgrading Flow
50
currentTransition._updatedFibers.clear();
51
}
52
}
packages/scheduler/src/forks/SchedulerMock.js
-3
@@ -520,7 +520,6 @@ function unstable_flushNumberOfYields(count: number): void {
520
try {
521
let hasMoreWork = true;
522
do {
523
- // $FlowFixMe[not-a-function] found when upgrading Flow
523
hasMoreWork = cb(true, currentMockTime);
524
} while (hasMoreWork && !didStop);
525
if (!hasMoreWork) {
@@ -546,7 +545,6 @@ function unstable_flushUntilNextPaint(): false {
545
try {
546
let hasMoreWork = true;
547
do {
549
- // $FlowFixMe[not-a-function] found when upgrading Flow
548
hasMoreWork = cb(true, currentMockTime);
549
} while (hasMoreWork && !didStop);
550
if (!hasMoreWork) {
@@ -593,7 +591,6 @@ function unstable_flushAllWithoutAsserting(): boolean {
591
try {
592
let hasMoreWork = true;
593
do {
596
- // $FlowFixMe[not-a-function] found when upgrading Flow
594
hasMoreWork = cb(true, currentMockTime);
595
} while (hasMoreWork);
596
if (!hasMoreWork) {