Skip to content

Commit b9ea14c

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Standardize subtyping error code into incompatible-type in react native and metro (#53312)
Summary: Pull Request resolved: #53312 Changelog: [Internal] Reviewed By: jbrown215 Differential Revision: D80400976
1 parent 47a9a2b commit b9ea14c

File tree

188 files changed

+489
-488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+489
-488
lines changed

.flowconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ module.system.haste.module_ref_prefix=m#
7575

7676
react.runtime=automatic
7777

78+
experimental.error_code_migration=new
7879
suppress_type=$FlowFixMe
7980

8081
ban_spread_key_props=true

flow-typed/npm/ws_v7.x.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ declare type ws$PerMessageDeflateOptions = {
2121
maxPayload?: number,
2222
};
2323

24-
/* $FlowFixMe[incompatible-extend] - Found with Flow v0.143.1 upgrade
24+
/* $FlowFixMe[incompatible-type] - Found with Flow v0.143.1 upgrade
2525
* "on" definition failing with string is incompatible with string literal */
2626
declare class ws$WebSocketServer extends events$EventEmitter {
2727
/**
@@ -141,7 +141,7 @@ declare type ws$UnexpectedResponseListener = (
141141
) => mixed;
142142
declare type ws$UpgradeListener = (response: http$IncomingMessage<>) => mixed;
143143

144-
/* $FlowFixMe[incompatible-extend] - Found with Flow v0.143.1 upgrade
144+
/* $FlowFixMe[incompatible-type] - Found with Flow v0.143.1 upgrade
145145
* "on" definition failing with string is incompatible with string literal */
146146
declare class ws$WebSocket extends events$EventEmitter {
147147
static Server: typeof ws$WebSocketServer;

jest/preprocessor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports = {
8686
globalPrefix: '',
8787
hermesParser: true,
8888
hot: false,
89-
// $FlowFixMe[incompatible-call] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS
89+
// $FlowFixMe[incompatible-type] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS
9090
inlineRequires: true,
9191
minify: false,
9292
platform: '',
@@ -111,7 +111,7 @@ module.exports = {
111111

112112
return generate(
113113
ast,
114-
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
114+
// $FlowFixMe[incompatible-type] Error found when improving flow typing for libs
115115
{
116116
code: true,
117117
comments: false,

packages/community-cli-plugin/src/commands/bundle/saveAssets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function copyAll(filesToCopy: CopiedFiles) {
116116
const src = queue.shift();
117117
// $FlowFixMe[incompatible-type]
118118
const dest = filesToCopy[src];
119-
// $FlowFixMe[incompatible-call]
119+
// $FlowFixMe[incompatible-type]
120120
copy(src, dest, copyNext);
121121
}
122122
};

packages/dev-middleware/src/__tests__/InspectorDebuggerUtils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ export class DebuggerMock extends DebuggerAgent {
105105
: this.handle.mock.calls;
106106
// $FlowFixMe[incompatible-use]
107107
// $FlowFixMe[prop-missing]
108+
// $FlowFixMe[incompatible-type]
108109
const [response] = newHandleCalls.find(args => args[0].id === message.id);
109-
// $FlowFixMe[incompatible-return]
110+
// $FlowFixMe[incompatible-type]
110111
// $FlowFixMe[incompatible-indexer]
111112
return response;
112113
}

packages/dev-middleware/src/__tests__/InspectorDeviceUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ export class DeviceMock extends DeviceAgent {
152152
if (!payload) {
153153
return;
154154
}
155-
// $FlowFixMe[incompatible-call] TODO(moti) Figure out the right way to type maybePayload generically
155+
// $FlowFixMe[incompatible-type] TODO(moti) Figure out the right way to type maybePayload generically
156156
this.send({event, payload});
157157
});
158158
return;
159159
}
160-
// $FlowFixMe[incompatible-call] TODO(moti) Figure out the right way to type maybePayload generically
160+
// $FlowFixMe[incompatible-type] TODO(moti) Figure out the right way to type maybePayload generically
161161
this.send({event, payload: maybePayload});
162162
}
163163
}

packages/dev-middleware/src/__tests__/InspectorProtocolUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function sendFromTargetToDebugger<Message: CdpMessageFromTarget>(
6666
: debugger_.handle.mock.calls;
6767
// $FlowFixMe[incompatible-type]
6868
const [receivedMessage]: [Message] = newHandleCalls.find(
69-
// $FlowFixMe[incompatible-call]
69+
// $FlowFixMe[incompatible-type]
7070
(call: [Message]) => call[0].method === message.method,
7171
);
7272
return receivedMessage;
@@ -103,7 +103,7 @@ export async function sendFromDebuggerToTarget<Message: CdpMessageToTarget>(
103103
// $FlowFixMe[incompatible-use]
104104
call => call[0].wrappedEvent.id === message.id,
105105
);
106-
// $FlowFixMe[incompatible-return]
106+
// $FlowFixMe[incompatible-type]
107107
return receivedMessage.wrappedEvent;
108108
}
109109

packages/dev-middleware/src/__tests__/ServerUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export async function createServer(options: CreateServerOptions): Promise<{
9393
);
9494
httpServer = https.createServer(
9595
{cert, key},
96-
// $FlowFixMe[incompatible-call] The types for `connect` and `https` are subtly incompatible as written.
96+
// $FlowFixMe[incompatible-type] The types for `connect` and `https` are subtly incompatible as written.
9797
app,
9898
);
9999
} else {

packages/dev-middleware/src/__tests__/getBaseUrlFromRequest-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function makeRequest(
4040
host: ?string,
4141
encrypted: boolean,
4242
): http$IncomingMessage<> | http$IncomingMessage<tls$TLSSocket> {
43-
// $FlowFixMe[incompatible-return] Partial mock of request
43+
// $FlowFixMe[incompatible-type] Partial mock of request
4444
return {
4545
socket: encrypted ? {encrypted: true} : {},
4646
headers: host != null ? {host} : {},

packages/dev-middleware/src/createDevMiddleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function createDevMiddleware({
8181
projectRoot,
8282
serverBaseUrl,
8383
logger,
84-
// $FlowFixMe[prop-missing]
84+
// $FlowFixMe[incompatible-type]
8585
unstable_browserLauncher = DefaultBrowserLauncher,
8686
unstable_eventReporter,
8787
unstable_experiments: experimentConfig = {},

0 commit comments

Comments
 (0)