Skip to content

Commit

Permalink
[flow] remove custom suppress comment config
Browse files Browse the repository at this point in the history
  • Loading branch information
kassens committed Sep 1, 2022
1 parent 2e7f422 commit c4f4f7a
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 34 deletions.
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ setAttemptHydrationAtPriority(runWithPriority);
if (__DEV__) {
if (
typeof Map !== 'function' ||
// $FlowIssue Flow incorrectly thinks Map has no prototype
// $FlowFixMe Flow incorrectly thinks Map has no prototype
Map.prototype == null ||
typeof Map.prototype.forEach !== 'function' ||
typeof Set !== 'function' ||
// $FlowIssue Flow incorrectly thinks Set has no prototype
// $FlowFixMe Flow incorrectly thinks Set has no prototype
Set.prototype == null ||
typeof Set.prototype.clear !== 'function' ||
typeof Set.prototype.forEach !== 'function'
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ export function createElement(
const firstChild = ((div.firstChild: any): HTMLScriptElement);
domElement = div.removeChild(firstChild);
} else if (typeof props.is === 'string') {
// $FlowIssue `createElement` should be updated for Web Components
// $FlowFixMe `createElement` should be updated for Web Components
domElement = ownerDocument.createElement(type, {is: props.is});
} else {
// Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/server/ReactDOMServerFormatConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ function pushAttribute(
// shouldRemoveAttribute
switch (typeof value) {
case 'function':
// $FlowIssue symbol is perfectly valid here
// $FlowFixMe symbol is perfectly valid here
case 'symbol': // eslint-disable-line
return;
case 'boolean': {
Expand Down Expand Up @@ -586,7 +586,7 @@ function pushAttribute(
// shouldRemoveAttribute
switch (typeof value) {
case 'function':
// $FlowIssue symbol is perfectly valid here
// $FlowFixMe symbol is perfectly valid here
case 'symbol': // eslint-disable-line
return;
case 'boolean': {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/shared/DOMProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function shouldRemoveAttributeWithWarning(
}
switch (typeof value) {
case 'function':
// $FlowIssue symbol is perfectly valid here
// $FlowFixMe symbol is perfectly valid here
case 'symbol': // eslint-disable-line
return true;
case 'boolean': {
Expand Down
10 changes: 5 additions & 5 deletions packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ function findHostInstance_DEPRECATED<TElementType: ElementType>(
if (componentOrHandle == null) {
return null;
}
// $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
// $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
if (componentOrHandle._nativeTag) {
// $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
// $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
return componentOrHandle;
}
// $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
// $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) {
// $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
// $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
return componentOrHandle.canonical;
}
let hostInstance;
Expand Down Expand Up @@ -226,7 +226,7 @@ function render(
}
updateContainer(element, root, null, callback);

// $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
// $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
return getPublicRootInstance(root);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactNativeRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function render(
}
updateContainer(element, root, null, callback);

// $FlowIssue Flow has hardcoded values for React DOM that don't work with RN
// $FlowFixMe Flow has hardcoded values for React DOM that don't work with RN
return getPublicRootInstance(root);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/react-reconciler/src/ReactFiberAct.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export function isLegacyActEnvironment(fiber: Fiber) {
// to false.

const isReactActEnvironmentGlobal =
// $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
// $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
? IS_REACT_ACT_ENVIRONMENT
: undefined;

// $FlowExpectedError - Flow doesn't know about jest
// $FlowFixMe - Flow doesn't know about jest
const jestIsDefined = typeof jest !== 'undefined';
return (
warnsIfNotActing && jestIsDefined && isReactActEnvironmentGlobal !== false
Expand All @@ -40,7 +40,7 @@ export function isLegacyActEnvironment(fiber: Fiber) {
export function isConcurrentActEnvironment() {
if (__DEV__) {
const isReactActEnvironmentGlobal =
// $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
// $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
? IS_REACT_ACT_ENVIRONMENT
: undefined;
Expand Down
6 changes: 3 additions & 3 deletions packages/react-reconciler/src/ReactFiberAct.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ export function isLegacyActEnvironment(fiber: Fiber) {
// to false.

const isReactActEnvironmentGlobal =
// $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
// $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
? IS_REACT_ACT_ENVIRONMENT
: undefined;

// $FlowExpectedError - Flow doesn't know about jest
// $FlowFixMe - Flow doesn't know about jest
const jestIsDefined = typeof jest !== 'undefined';
return (
warnsIfNotActing && jestIsDefined && isReactActEnvironmentGlobal !== false
Expand All @@ -40,7 +40,7 @@ export function isLegacyActEnvironment(fiber: Fiber) {
export function isConcurrentActEnvironment() {
if (__DEV__) {
const isReactActEnvironmentGlobal =
// $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
// $FlowFixMe – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global
typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined'
? IS_REACT_ACT_ENVIRONMENT
: undefined;
Expand Down
12 changes: 6 additions & 6 deletions packages/react-refresh/src/ReactFreshRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
// We never remove these associations.
// It's OK to reference families, but use WeakMap/Set for types.
const allFamiliesByID: Map<string, Family> = new Map();
const allFamiliesByType: // $FlowIssue
const allFamiliesByType: // $FlowFixMe
WeakMap<any, Family> | Map<any, Family> = new PossiblyWeakMap();
const allSignaturesByType: // $FlowIssue
const allSignaturesByType: // $FlowFixMe
WeakMap<any, Signature> | Map<any, Signature> = new PossiblyWeakMap();
// This WeakMap is read by React, so we only put families
// that have actually been edited here. This keeps checks fast.
// $FlowIssue
const updatedFamiliesByType: // $FlowIssue
// $FlowFixMe
const updatedFamiliesByType: // $FlowFixMe
WeakMap<any, Family> | Map<any, Family> = new PossiblyWeakMap();

// This is cleared on every performReactRefresh() call.
Expand All @@ -74,8 +74,8 @@ const failedRoots: Set<FiberRoot> = new Set();
// In environments that support WeakMap, we also remember the last element for every root.
// It needs to be weak because we do this even for roots that failed to mount.
// If there is no WeakMap, we won't attempt to do retrying.
// $FlowIssue
const rootElements: WeakMap<any, ReactNodeList> | null = // $FlowIssue
// $FlowFixMe
const rootElements: WeakMap<any, ReactNodeList> | null = // $FlowFixMe
typeof WeakMap === 'function' ? new WeakMap() : null;

let isPerformingRefresh = false;
Expand Down
10 changes: 0 additions & 10 deletions scripts/flow/config/flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,5 @@ esproposal.optional_chaining=enable

munge_underscores=false

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_type=$FlowExpectedError

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.97.0

0 comments on commit c4f4f7a

Please sign in to comment.