Remove unused Flow suppressions (#25977)

These suppressions are no longer required.

Generated using:
```sh
flow/tool update-suppressions .
```
followed by adding back 1 or 2 suppressions that were only triggered in
some configurations.
This commit is contained in:
Jan Kassens 2023-01-10 10:32:42 -05:00 committed by GitHub
parent afe6521e13
commit c49131669b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 4 additions and 30 deletions

View File

@ -125,7 +125,6 @@ function accessResult<I, K, V>(
status: Pending, status: Pending,
value: thenable, value: thenable,
}; };
// $FlowFixMe[escaped-generic] discovered when updating Flow
const newEntry = lru.add(newResult, deleteEntry.bind(null, resource, key)); const newEntry = lru.add(newResult, deleteEntry.bind(null, resource, key));
entriesForResource.set(key, newEntry); entriesForResource.set(key, newEntry);
return newResult; return newResult;

View File

@ -148,7 +148,6 @@ export function connectToDevTools(options: ?ConnectOptions) {
} }
}, },
}); });
// $FlowFixMe[incompatible-use] found when upgrading Flow
bridge.addListener( bridge.addListener(
'updateComponentFilters', 'updateComponentFilters',
(componentFilters: Array<ComponentFilter>) => { (componentFilters: Array<ComponentFilter>) => {

View File

@ -81,7 +81,6 @@ export function activate(
bridge, bridge,
}: { }: {
bridge?: BackendBridge, bridge?: BackendBridge,
// $FlowFixMe[incompatible-exact]
} = {}, } = {},
): void { ): void {
if (bridge == null) { if (bridge == null) {

View File

@ -63,7 +63,6 @@ export function initialize(
}: { }: {
bridge?: FrontendBridge, bridge?: FrontendBridge,
store?: Store, store?: Store,
// $FlowFixMe[incompatible-exact]
} = {}, } = {},
): React.AbstractComponent<Props, mixed> { ): React.AbstractComponent<Props, mixed> {
if (bridge == null) { if (bridge == null) {

View File

@ -151,7 +151,6 @@ export function serializeToString(data: any): string {
} }
cache.add(value); cache.add(value);
} }
// $FlowFixMe
if (typeof value === 'bigint') { if (typeof value === 'bigint') {
return value.toString() + 'n'; return value.toString() + 'n';
} }

View File

@ -17,7 +17,6 @@ function wrapWithHoc(Component: () => any, index: number) {
const displayName = (Component: any).displayName || Component.name; const displayName = (Component: any).displayName || Component.name;
// $FlowFixMe[incompatible-type] found when upgrading Flow
HOC.displayName = `withHoc${index}(${displayName})`; HOC.displayName = `withHoc${index}(${displayName})`;
return HOC; return HOC;
} }

View File

@ -31,7 +31,6 @@ const immutable = Immutable.fromJS({
xyz: 1, xyz: 1,
}, },
}); });
// $FlowFixMe
const bigInt = BigInt(123); // eslint-disable-line no-undef const bigInt = BigInt(123); // eslint-disable-line no-undef
export default function UnserializableProps(): React.Node { export default function UnserializableProps(): React.Node {

View File

@ -201,7 +201,6 @@ function getRootNode(container: Container): FloatRoot {
function getCurrentResourceRoot(): null | FloatRoot { function getCurrentResourceRoot(): null | FloatRoot {
const currentContainer = getCurrentRootHostContainer(); const currentContainer = getCurrentRootHostContainer();
// $FlowFixMe flow should know currentContainer is a Node and has getRootNode
return currentContainer ? getRootNode(currentContainer) : null; return currentContainer ? getRootNode(currentContainer) : null;
} }

View File

@ -782,11 +782,9 @@ export function resourcesFromLink(props: Props): boolean {
if (__DEV__) { if (__DEV__) {
validateLinkPropsForStyleResource(props); validateLinkPropsForStyleResource(props);
} }
// $FlowFixMe[incompatible-use] found when upgrading Flow
let preloadResource = resources.preloadsMap.get(href); let preloadResource = resources.preloadsMap.get(href);
if (!preloadResource) { if (!preloadResource) {
preloadResource = createPreloadResource( preloadResource = createPreloadResource(
// $FlowFixMe[incompatible-call] found when upgrading Flow
resources, resources,
href, href,
'style', 'style',
@ -937,7 +935,6 @@ export function resourcesFromScript(props: Props): boolean {
let preloadResource = resources.preloadsMap.get(src); let preloadResource = resources.preloadsMap.get(src);
if (!preloadResource) { if (!preloadResource) {
preloadResource = createPreloadResource( preloadResource = createPreloadResource(
// $FlowFixMe[incompatible-call] found when upgrading Flow
resources, resources,
src, src,
'script', 'script',

View File

@ -599,7 +599,6 @@ function updateSimpleMemoComponent(
try { try {
outerMemoType = init(payload); outerMemoType = init(payload);
} catch (x) { } catch (x) {
// $FlowFixMe[incompatible-type] found when upgrading Flow
outerMemoType = null; outerMemoType = null;
} }
// Inner propTypes will be validated in the function component path. // Inner propTypes will be validated in the function component path.

View File

@ -2391,12 +2391,9 @@ function getRetryCache(finishedWork: Fiber) {
} }
case OffscreenComponent: { case OffscreenComponent: {
const instance: OffscreenInstance = finishedWork.stateNode; const instance: OffscreenInstance = finishedWork.stateNode;
// $FlowFixMe[incompatible-type-arg] found when upgrading Flow
let retryCache: null | Set<Wakeable> | WeakSet<Wakeable> = let retryCache: null | Set<Wakeable> | WeakSet<Wakeable> =
// $FlowFixMe[incompatible-type] found when upgrading Flow
instance._retryCache; instance._retryCache;
if (retryCache === null) { if (retryCache === null) {
// $FlowFixMe[incompatible-type]
retryCache = instance._retryCache = new PossiblyWeakSet(); retryCache = instance._retryCache = new PossiblyWeakSet();
} }
return retryCache; return retryCache;

View File

@ -24,7 +24,6 @@ if (__DEV__) {
warnedAboutMissingGetChildContext = ({}: {[string]: boolean}); warnedAboutMissingGetChildContext = ({}: {[string]: boolean});
} }
// $FlowFixMe[incompatible-exact]
export const emptyContextObject: {} = {}; export const emptyContextObject: {} = {};
if (__DEV__) { if (__DEV__) {
Object.freeze(emptyContextObject); Object.freeze(emptyContextObject);

View File

@ -2806,7 +2806,6 @@ const HooksDispatcherOnMount: Dispatcher = {
useId: mountId, useId: mountId,
}; };
if (enableCache) { if (enableCache) {
// $FlowFixMe[escaped-generic] discovered when updating Flow
(HooksDispatcherOnMount: Dispatcher).useCacheRefresh = mountRefresh; (HooksDispatcherOnMount: Dispatcher).useCacheRefresh = mountRefresh;
} }
if (enableUseHook) { if (enableUseHook) {

View File

@ -54,7 +54,6 @@ export type OffscreenInstance = {
_visibility: OffscreenVisibility, _visibility: OffscreenVisibility,
_pendingMarkers: Set<TracingMarkerInstance> | null, _pendingMarkers: Set<TracingMarkerInstance> | null,
_transitions: Set<Transition> | null, _transitions: Set<Transition> | null,
// $FlowFixMe[incompatible-type-arg] found when upgrading Flow
_retryCache: WeakSet<Wakeable> | Set<Wakeable> | null, _retryCache: WeakSet<Wakeable> | Set<Wakeable> | null,
// Represents the current Offscreen fiber // Represents the current Offscreen fiber

View File

@ -1813,7 +1813,6 @@ function handleThrow(root: FiberRoot, thrownValue: any): void {
const isWakeable = const isWakeable =
thrownValue !== null && thrownValue !== null &&
typeof thrownValue === 'object' && typeof thrownValue === 'object' &&
// $FlowFixMe[method-unbinding]
typeof thrownValue.then === 'function'; typeof thrownValue.then === 'function';
workInProgressSuspendedReason = isWakeable workInProgressSuspendedReason = isWakeable
@ -3458,7 +3457,6 @@ export function resolveRetryWakeable(boundaryFiber: Fiber, wakeable: Wakeable) {
break; break;
case OffscreenComponent: { case OffscreenComponent: {
const instance: OffscreenInstance = boundaryFiber.stateNode; const instance: OffscreenInstance = boundaryFiber.stateNode;
// $FlowFixMe[incompatible-type] found when upgrading Flow
retryCache = instance._retryCache; retryCache = instance._retryCache;
break; break;
} }

View File

@ -50,8 +50,9 @@ const allFamiliesByID: Map<string, Family> = new Map();
const allFamiliesByType: const allFamiliesByType:
| WeakMap<any, Family> | WeakMap<any, Family>
| Map<any, Family> = new PossiblyWeakMap(); | Map<any, Family> = new PossiblyWeakMap();
const allSignaturesByType: // $FlowFixMe const allSignaturesByType:
WeakMap<any, Signature> | Map<any, Signature> = new PossiblyWeakMap(); | WeakMap<any, Signature>
| Map<any, Signature> = new PossiblyWeakMap();
// This WeakMap is read by React, so we only put families // This WeakMap is read by React, so we only put families
// that have actually been edited here. This keeps checks fast. // that have actually been edited here. This keeps checks fast.
const updatedFamiliesByType: const updatedFamiliesByType:

View File

@ -17,7 +17,6 @@ if (__DEV__) {
warnedAboutMissingGetChildContext = ({}: {[string]: boolean}); warnedAboutMissingGetChildContext = ({}: {[string]: boolean});
} }
// $FlowFixMe[incompatible-exact]
export const emptyContextObject: {} = {}; export const emptyContextObject: {} = {};
if (__DEV__) { if (__DEV__) {
Object.freeze(emptyContextObject); Object.freeze(emptyContextObject);

View File

@ -36,7 +36,6 @@ export const DefaultCacheDispatcher: CacheDispatcher = {
let entry: AbortSignal | void = (cache.get(createSignal): any); let entry: AbortSignal | void = (cache.get(createSignal): any);
if (entry === undefined) { if (entry === undefined) {
entry = createSignal(); entry = createSignal();
// $FlowFixMe[incompatible-use] found when upgrading Flow
cache.set(createSignal, entry); cache.set(createSignal, entry);
} }
return entry; return entry;
@ -47,7 +46,6 @@ export const DefaultCacheDispatcher: CacheDispatcher = {
if (entry === undefined) { if (entry === undefined) {
entry = resourceType(); entry = resourceType();
// TODO: Warn if undefined? // TODO: Warn if undefined?
// $FlowFixMe[incompatible-use] found when upgrading Flow
cache.set(resourceType, entry); cache.set(resourceType, entry);
} }
return entry; return entry;

View File

@ -1006,7 +1006,6 @@ export function resolveModelToJSON(
return serializeByValueID(symbolId); return serializeByValueID(symbolId);
} }
// $FlowFixMe: bigint isn't added to Flow yet.
if (typeof value === 'bigint') { if (typeof value === 'bigint') {
throw new Error( throw new Error(
`BigInt (${value}) is not yet supported in Client Component props.` + `BigInt (${value}) is not yet supported in Client Component props.` +

View File

@ -71,7 +71,6 @@ export function clonePrecomputedChunk(
} }
export function closeWithError(destination: Destination, error: mixed): void { export function closeWithError(destination: Destination, error: mixed): void {
// $FlowFixMe[method-unbinding]
if (typeof destination.error === 'function') { if (typeof destination.error === 'function') {
// $FlowFixMe: This is an Error object or the destination accepts other types. // $FlowFixMe: This is an Error object or the destination accepts other types.
destination.error(error); destination.error(error);

View File

@ -11,9 +11,7 @@ const ReactDebugCurrentFrame: {
setExtraStackFrame?: (stack: null | string) => void, setExtraStackFrame?: (stack: null | string) => void,
getCurrentStack?: null | (() => string), getCurrentStack?: null | (() => string),
getStackAddendum?: () => string, getStackAddendum?: () => string,
} = } = {};
// $FlowFixMe[incompatible-exact]
{};
let currentExtraStackFrame = (null: null | string); let currentExtraStackFrame = (null: null | string);