From 77021fd20b0a79d50fed45479c67b293dae92a40 Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Wed, 14 Oct 2026 15:00:59 -0700 Subject: [PATCH] Use `any` for untyped `Object`/`Function` in flow-typed and debugger-shell (#59092) Summary: X-link: https://github.com/react/metro/pull/2069 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` 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] Differential Revision: D125303674 --- flow-typed/npm/@react-native-community/cli-types_v19.x.x.js | 2 +- flow-typed/npm/yargs_v17.x.x.js | 2 +- packages/debugger-shell/src/electron/SettingsStore.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flow-typed/npm/@react-native-community/cli-types_v19.x.x.js b/flow-typed/npm/@react-native-community/cli-types_v19.x.x.js index 308beeecf20e..98965820c138 100644 --- a/flow-typed/npm/@react-native-community/cli-types_v19.x.x.js +++ b/flow-typed/npm/@react-native-community/cli-types_v19.x.x.js @@ -35,7 +35,7 @@ declare module '@react-native-community/cli-types' { name: string, version: string, }, - func: CommandFunction, + func: CommandFunction, options?: Array OptionValue>>, }; diff --git a/flow-typed/npm/yargs_v17.x.x.js b/flow-typed/npm/yargs_v17.x.x.js index 07077c11f282..1c78d56a73da 100644 --- a/flow-typed/npm/yargs_v17.x.x.js +++ b/flow-typed/npm/yargs_v17.x.x.js @@ -103,7 +103,7 @@ declare module 'yargs' { builder?: | {[key: string]: Options, ...} | ((yargsInstance: Yargs) => unknown), - handler?: Function, + handler?: any, ): this; command( cmd: string | Array, diff --git a/packages/debugger-shell/src/electron/SettingsStore.js b/packages/debugger-shell/src/electron/SettingsStore.js index c4714beed615..569361b45636 100644 --- a/packages/debugger-shell/src/electron/SettingsStore.js +++ b/packages/debugger-shell/src/electron/SettingsStore.js @@ -30,7 +30,7 @@ type Options = Readonly<{ * - Supports the Electron main process only. */ export default class SettingsStore { - #defaultValues: Object = {}; + #defaultValues: any = {}; path: string; constructor(options: Options = {}) {