[flow] remove custom suppress comment config (#25170)
Jan Kassens committed
Sep 1, 2022 at 12:55 UTC
f0efa1164b7ca8523b081223954d05c88e92053b
10 files changed
+24
-34
packages/react-dom/src/client/ReactDOM.js
+2
-2
@@ -82,11 +82,11 @@ setAttemptHydrationAtPriority(runWithPriority);
82
if (__DEV__) {
83
if (
84
typeof Map !== 'function' ||
85
- // $FlowIssue Flow incorrectly thinks Map has no prototype
85
+ // $FlowFixMe Flow incorrectly thinks Map has no prototype
86
Map.prototype == null ||
87
typeof Map.prototype.forEach !== 'function' ||
88
typeof Set !== 'function' ||
89
- // $FlowIssue Flow incorrectly thinks Set has no prototype
89
+ // $FlowFixMe Flow incorrectly thinks Set has no prototype
90
Set.prototype == null ||
91
typeof Set.prototype.clear !== 'function' ||
92
typeof Set.prototype.forEach !== 'function'
packages/react-dom/src/client/ReactDOMComponent.js
+1
-1
@@ -420,7 +420,7 @@ export function createElement(
420
const firstChild = ((div.firstChild: any): HTMLScriptElement);
421
domElement = div.removeChild(firstChild);
422
} else if (typeof props.is === 'string') {
423
- // $FlowIssue `createElement` should be updated for Web Components
423
+ // $FlowFixMe `createElement` should be updated for Web Components
424
domElement = ownerDocument.createElement(type, {is: props.is});
425
} else {
426
// Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
packages/react-dom/src/server/ReactDOMServerFormatConfig.js
+2
-2
@@ -477,7 +477,7 @@ function pushAttribute(
477
// shouldRemoveAttribute
478
switch (typeof value) {
479
case 'function':
480
- // $FlowIssue symbol is perfectly valid here
480
+ // $FlowFixMe symbol is perfectly valid here
481
case 'symbol': // eslint-disable-line
482
return;
483
case 'boolean': {
@@ -586,7 +586,7 @@ function pushAttribute(
586
// shouldRemoveAttribute
587
switch (typeof value) {
588
case 'function':
589
- // $FlowIssue symbol is perfectly valid here
589
+ // $FlowFixMe symbol is perfectly valid here
590
case 'symbol': // eslint-disable-line
591
return;
592
case 'boolean': {
packages/react-dom/src/shared/DOMProperty.js
+1
-1
@@ -123,7 +123,7 @@ export function shouldRemoveAttributeWithWarning(
123
}
124
switch (typeof value) {
125
case 'function':
126
- // $FlowIssue symbol is perfectly valid here
126
+ // $FlowFixMe symbol is perfectly valid here
127
case 'symbol': // eslint-disable-line
128
return true;
129
case 'boolean': {
packages/react-native-renderer/src/ReactFabric.js
+5
-5
@@ -69,14 +69,14 @@ function findHostInstance_DEPRECATED<TElementType: ElementType>(
69
if (componentOrHandle == null) {
70
return null;
71
}
72
- // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
72
+ // $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
73
if (componentOrHandle._nativeTag) {
74
- // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
74
+ // $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
75
return componentOrHandle;
76
}
77
- // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
77
+ // $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
78
if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) {
79
- // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
79
+ // $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
80
return componentOrHandle.canonical;
81
}
82
let hostInstance;
@@ -226,7 +226,7 @@ function render(
226
}
227
updateContainer(element, root, null, callback);
228
229
- // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
229
+ // $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
230
return getPublicRootInstance(root);
231
}
232
packages/react-native-renderer/src/ReactNativeRenderer.js
+1
-1
@@ -222,7 +222,7 @@ function render(
222
}
223
updateContainer(element, root, null, callback);
224
225
- // $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
225
+ // $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
226
return getPublicRootInstance(root);
227
}
228
packages/react-reconciler/src/ReactFiberAct.new.js
+3
-3
@@ -23,12 +23,12 @@ export function isLegacyActEnvironment(fiber: Fiber) {
23
// to false.
24
25
const isReactActEnvironmentGlobal =
26
- // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
26
+ // $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
27
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
28
? IS_REACT_ACT_ENVIRONMENT
29
: undefined;
30
31
- // $FlowExpectedError - Flow doesn't know about jest
31
+ // $FlowFixMe - Flow doesn't know about jest
32
const jestIsDefined = typeof jest !== 'undefined';
33
return (
34
warnsIfNotActing && jestIsDefined && isReactActEnvironmentGlobal !== false
@@ -40,7 +40,7 @@ export function isLegacyActEnvironment(fiber: Fiber) {
40
export function isConcurrentActEnvironment() {
41
if (__DEV__) {
42
const isReactActEnvironmentGlobal =
43
- // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
43
+ // $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
44
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
45
? IS_REACT_ACT_ENVIRONMENT
46
: undefined;
packages/react-reconciler/src/ReactFiberAct.old.js
+3
-3
@@ -23,12 +23,12 @@ export function isLegacyActEnvironment(fiber: Fiber) {
23
// to false.
24
25
const isReactActEnvironmentGlobal =
26
- // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
26
+ // $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
27
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
28
? IS_REACT_ACT_ENVIRONMENT
29
: undefined;
30
31
- // $FlowExpectedError - Flow doesn't know about jest
31
+ // $FlowFixMe - Flow doesn't know about jest
32
const jestIsDefined = typeof jest !== 'undefined';
33
return (
34
warnsIfNotActing && jestIsDefined && isReactActEnvironmentGlobal !== false
@@ -40,7 +40,7 @@ export function isLegacyActEnvironment(fiber: Fiber) {
40
export function isConcurrentActEnvironment() {
41
if (__DEV__) {
42
const isReactActEnvironmentGlobal =
43
- // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
43
+ // $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
44
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
45
? IS_REACT_ACT_ENVIRONMENT
46
: undefined;
packages/react-refresh/src/ReactFreshRuntime.js
+6
-6
@@ -47,14 +47,14 @@ 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: // $FlowIssue
50
+const allFamiliesByType: // $FlowFixMe
51
WeakMap<any, Family> | Map<any, Family> = new PossiblyWeakMap();
52
-const allSignaturesByType: // $FlowIssue
52
+const allSignaturesByType: // $FlowFixMe
53
WeakMap<any, Signature> | Map<any, Signature> = new PossiblyWeakMap();
54
// This WeakMap is read by React, so we only put families
55
// that have actually been edited here. This keeps checks fast.
56
-// $FlowIssue
57
-const updatedFamiliesByType: // $FlowIssue
56
+// $FlowFixMe
57
+const updatedFamiliesByType: // $FlowFixMe
58
WeakMap<any, Family> | Map<any, Family> = new PossiblyWeakMap();
59
60
// This is cleared on every performReactRefresh() call.
@@ -74,8 +74,8 @@ const failedRoots: Set<FiberRoot> = new Set();
74
// In environments that support WeakMap, we also remember the last element for every root.
75
// It needs to be weak because we do this even for roots that failed to mount.
76
// If there is no WeakMap, we won't attempt to do retrying.
77
-// $FlowIssue
78
-const rootElements: WeakMap<any, ReactNodeList> | null = // $FlowIssue
77
+// $FlowFixMe
78
+const rootElements: WeakMap<any, ReactNodeList> | null = // $FlowFixMe
79
typeof WeakMap === 'function' ? new WeakMap() : null;
80
81
let isPerformingRefresh = false;
scripts/flow/config/flowconfig
-10
@@ -49,15 +49,5 @@ esproposal.optional_chaining=enable
49
50
munge_underscores=false
51
52
-suppress_type=$FlowIssue
53
-suppress_type=$FlowFixMe
54
-suppress_type=$FixMe
55
-suppress_type=$FlowExpectedError
56
-
57
-suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
58
-suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
59
-suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
60
-suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
61
-
52
[version]
53
^0.97.0