Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.system.haste.module_ref_prefix=m#

react.runtime=automatic

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
Expand Down
4 changes: 2 additions & 2 deletions packages/debugger-shell/__tests__/electron-dependency-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ const semver = require('semver');
// safety to ensure the target of the resolution is in sync with the declared dependency.
describe('Electron dependency', () => {
test('should be semver-satisfied by the actual electron version', () => {
// $FlowIssue[untyped-import] - package.json is not typed
// $FlowFixMe[untyped-import] - package.json is not typed
const ourPackageJson = require('../package.json');

const declaredElectronVersion = ourPackageJson.dependencies.electron;
expect(declaredElectronVersion).toBeTruthy();

// $FlowIssue[untyped-import] - package.json is not typed
// $FlowFixMe[untyped-import] - package.json is not typed
const electronPackageJson = require('electron/package.json');

const actualElectronVersion = electronPackageJson.version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe('Animated', () => {
expect(console.warn).toBeCalledWith(
'Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`',
);
// $FlowIssue[prop-missing]
// $FlowFixMe[prop-missing]
console.warn.mockRestore();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MAX_DEPTH = 5;

export function isPlainObject(
value: mixed,
/* $FlowIssue[incompatible-type-guard] - Flow does not know that the prototype
/* $FlowFixMe[incompatible-type-guard] - Flow does not know that the prototype
and ReactElement checks preserve the type refinement of `value`. */
): value is $ReadOnly<{[string]: mixed}> {
return (
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native/Libraries/AppState/AppState.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,18 @@ class AppStateImpl {
}
switch (type) {
case 'change':
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
// $FlowFixMe[invalid-tuple-arity] Flow cannot refine handler based on the event type
const changeHandler: AppStateStatus => void = handler;
return emitter.addListener('appStateDidChange', appStateData => {
changeHandler(appStateData.app_state);
});
case 'memoryWarning':
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
// $FlowFixMe[invalid-tuple-arity] Flow cannot refine handler based on the event type
const memoryWarningHandler: () => void = handler;
return emitter.addListener('memoryWarning', memoryWarningHandler);
case 'blur':
case 'focus':
// $FlowIssue[invalid-tuple-arity] Flow cannot refine handler based on the event type
// $FlowFixMe[invalid-tuple-arity] Flow cannot refine handler based on the event type
const focusOrBlurHandler: () => void = handler;
return emitter.addListener('appStateFocusChange', hasFocus => {
if (type === 'blur' && !hasFocus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ const AccessibilityInfo = {
*/
addEventListener<K: $Keys<AccessibilityEventDefinitions>>(
eventName: K,
// $FlowIssue[incompatible-type] - Flow bug with unions and generics (T128099423)
// $FlowFixMe[incompatible-type] - Flow bug with unions and generics (T128099423)
handler: (...AccessibilityEventDefinitions[K]) => void,
): EventSubscription {
const deviceEventName = EventNames.get(eventName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const Switch: component(
native.value != null && native.value !== jsValue;
if (
shouldUpdateNativeSwitch &&
// $FlowIssue[method-unbinding]
// $FlowFixMe[method-unbinding]
nativeSwitchRef.current?.setNativeProps != null
) {
if (Platform.OS === 'android') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('JSTimers', () => {
});

afterEach(() => {
// $FlowIssue[prop-missing]
// $FlowFixMe[prop-missing]
console.warn.mockRestore();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const InteractionManagerStub = {
cancel: () => void,
...
} {
let immediateID: ?$FlowIssue;
let immediateID: ?$FlowFixMe;
const promise = new Promise(resolve => {
immediateID = setImmediate(() => {
if (typeof task === 'object' && task !== null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TestEffect {
this.key = key;
}
static called(name: string, key: ?string): $FlowFixMe {
// $FlowIssue[prop-missing] - Flow does not support type augmentation.
// $FlowFixMe[prop-missing] - Flow does not support type augmentation.
return expect.effect(name, key);
}
}
Expand All @@ -56,7 +56,7 @@ class TestEffectCleanup {
this.key = key;
}
static called(name: string, key: ?string): $FlowFixMe {
// $FlowIssue[prop-missing] - Flow does not support type augmentation.
// $FlowFixMe[prop-missing] - Flow does not support type augmentation.
return expect.effectCleanup(name, key);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Utilities/useMergeRefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function useMergeRefs<Instance>(
return undefined;
} else {
if (typeof ref === 'function') {
// $FlowIssue[incompatible-type] - Flow does not understand ref cleanup.
// $FlowFixMe[incompatible-type] - Flow does not understand ref cleanup.
const cleanup: void | (() => void) = ref(current);
return typeof cleanup === 'function'
? cleanup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function generateCode(
const outputDir =
reactNativeCoreLibraryOutputPath(libraryName, platform) ?? outputPath;
fs.mkdirSync(outputDir, {recursive: true});
// $FlowIssue[prop-missing] - `fs.cpSync` is missing in Flow libdefs.
// $FlowFixMe[prop-missing] - `fs.cpSync` is missing in Flow libdefs.
fs.cpSync(tmpOutputDir, outputDir, {recursive: true});
codegenLog(`Generated artifacts: ${outputDir}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

export default function ensureInstance<T>(value: mixed, Class: Class<T>): T {
if (!(value instanceof Class)) {
// $FlowIssue[incompatible-use]
// $FlowFixMe[incompatible-use]
const className = Class.name;
throw new Error(
`Expected instance of ${className} but got ${String(value)}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('Native Animated', () => {
expect.any(Number),
0.5,
);
// $FlowIssue[method-unbinding]
// $FlowFixMe[method-unbinding]
expect(ref.current?.setNativeProps).not.toHaveBeenCalled();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export function dispatchModeChangeEvent(
{
mode: mode as number,
targetRect,
// $FlowIssue[incompatible-cast] - https://fburl.com/workplace/t8a3yvuo
// $FlowFixMe[incompatible-cast] - https://fburl.com/workplace/t8a3yvuo
thresholdRect,
} as NativeModeChangeEvent,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default class ReadOnlyElement extends ReadOnlyNode {
}

function getChildElements(node: ReadOnlyNode): $ReadOnlyArray<ReadOnlyElement> {
// $FlowIssue[incompatible-call]
// $FlowFixMe[incompatible-call]
return getChildNodes(node).filter(
childNode => childNode instanceof ReadOnlyElement,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {setPlatformObject} from '../../webidl/PlatformObjects';
// IMPORTANT: The type definition for this module is defined in `HTMLCollection.js.flow`
// because Flow only supports indexers in classes in declaration files.

// $FlowIssue[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable<T> interface.
// $FlowFixMe[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable<T> interface.
export default class HTMLCollection<T> implements Iterable<T>, ArrayLike<T> {
#length: number;

Expand Down Expand Up @@ -64,7 +64,7 @@ export default class HTMLCollection<T> implements Iterable<T>, ArrayLike<T> {
return null;
}

// $FlowIssue[unsupported-syntax] Flow does not support computed properties in classes.
// $FlowFixMe[unsupported-syntax] Flow does not support computed properties in classes.
[Symbol.iterator](): Iterator<T> {
return createValueIterator(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {setPlatformObject} from '../../webidl/PlatformObjects';
// IMPORTANT: The Flow type definition for this module is defined in `NodeList.js.flow`
// because Flow only supports indexers in classes in declaration files.

// $FlowIssue[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable<T> interface.
// $FlowFixMe[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable<T> interface.
export default class NodeList<T> implements Iterable<T>, ArrayLike<T> {
#length: number;

Expand Down Expand Up @@ -88,7 +88,7 @@ export default class NodeList<T> implements Iterable<T>, ArrayLike<T> {
return createValueIterator(this);
}

// $FlowIssue[unsupported-syntax] Flow does not support computed properties in classes.
// $FlowFixMe[unsupported-syntax] Flow does not support computed properties in classes.
[Symbol.iterator](): Iterator<T> {
return createValueIterator(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {setPlatformObject} from '../webidl/PlatformObjects';
// IMPORTANT: The Flow type definition for this module is defined in `DOMRectList.js.flow`
// because Flow only supports indexers in classes in declaration files.

// $FlowIssue[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface.
// $FlowFixMe[prop-missing] Flow doesn't understand [Symbol.iterator]() {} and thinks this class doesn't implement the Iterable interface.
export default class DOMRectList implements Iterable<DOMRectReadOnly> {
#length: number;

Expand Down Expand Up @@ -58,7 +58,7 @@ export default class DOMRectList implements Iterable<DOMRectReadOnly> {
return arrayLike[index];
}

// $FlowIssue[unsupported-syntax] Flow does not support computed properties in classes.
// $FlowFixMe[unsupported-syntax] Flow does not support computed properties in classes.
[Symbol.iterator](): Iterator<DOMRectReadOnly> {
return createValueIterator(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function structuredCloneInternal<T>(value: T): T {
}

// Simple object fast path
// $FlowIssue[prop-missing] Why doesn't Flow know about Object.prototype?
// $FlowFixMe[prop-missing] Why doesn't Flow know about Object.prototype?
if (Object.getPrototypeOf(value) === ObjectPrototype) {
const result = {};
memory.set(value, result);
Expand Down
2 changes: 1 addition & 1 deletion private/react-native-fantom/src/Benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export function suite(
return {name: taskName, fn: taskFn, options: {...taskOptions, only}};
};

// $FlowIssue[incompatible-type]
// $FlowFixMe[incompatible-type]
const testEach: ParameterizedTestFunction = <TestArgType>(
testArgs: $ReadOnlyArray<TestArgType>,
name: TestWithArgName<TestArgType>,
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function validateTypeScriptDefs(packageName /*: string */) {
'\n',
);
console.log(
// $FlowIssue[incompatible-use] Type refined above
// $FlowFixMe[incompatible-use] Type refined above
`${diagnostic.file.fileName} (${line + 1},${
character + 1
}): ${message}`,
Expand Down
Loading