Skip to content

Commit e619ebd

Browse files
SamChou19815meta-codesync[bot]
authored andcommitted
Use any for untyped Object/Function in flow-typed and debugger-shell (#59092)
Summary: X-link: react/metro#2069 Pull Request resolved: #59092 With `experimental.function_and_object_type_is_no_longer_any`, Flow resolves `Object` and `Function` to the builtin class types instead of `any`. These annotations relied on the old meaning, so they become `any`: - `cli-types`: the `CommandFunction<Object>` of `Command.func`. Commands with exact arg types no longer fit it. - `yargs`: the `command` handler, which gave handlers an `any` context. `js1 fox` handlers rely on it. - `debugger-shell`: `SettingsStore`'s default values, which are read by key. Changelog: [Internal] Reviewed By: gkz Differential Revision: D125303674 fbshipit-source-id: 042b5ef6f84dc3d10190d14a4239b8f4cff7cadc
1 parent 1e70d04 commit e619ebd

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎flow-typed/npm/@react-native-community/cli-types_v19.x.x.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ declare module '@react-native-community/cli-types' {
3535
name: string,
3636
version: string,
3737
},
38-
func: CommandFunction<Object>,
38+
func: CommandFunction<any>,
3939
options?: Array<CommandOption<(ctx: Config) => OptionValue>>,
4040
};
4141

‎flow-typed/npm/yargs_v17.x.x.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ declare module 'yargs' {
103103
builder?:
104104
| {[key: string]: Options, ...}
105105
| ((yargsInstance: Yargs) => unknown),
106-
handler?: Function,
106+
handler?: any,
107107
): this;
108108
command(
109109
cmd: string | Array<string>,

‎packages/debugger-shell/src/electron/SettingsStore.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Options = Readonly<{
3030
* - Supports the Electron main process only.
3131
*/
3232
export default class SettingsStore {
33-
#defaultValues: Object = {};
33+
#defaultValues: any = {};
3434
path: string;
3535

3636
constructor(options: Options = {}) {

0 commit comments

Comments
 (0)