Use any for untyped Object/Function in flow-typed and debugger-shell (#59092)

Summary:
X-link: https://github.com/react/metro/pull/2069

Pull Request resolved: https://github.com/react/react-native/pull/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
This commit is contained in:
Sam Zhou authored and meta-codesync[bot] committed 2026-10-14 15:59:19 -07:00
1 parent 1e70d04ceb
commit e619ebd3a1
3 files changed
+3 -3

No files matched your search

@@ -35,7 +35,7 @@ declare module '@react-native-community/cli-types' {
name: string,
version: string,
},
func: CommandFunction<Object>,
func: CommandFunction<any>,
options?: Array<CommandOption<(ctx: Config) => OptionValue>>,
};
+1 -1
View File
@@ -103,7 +103,7 @@ declare module 'yargs' {
builder?:
| {[key: string]: Options, ...}
| ((yargsInstance: Yargs) => unknown),
handler?: Function,
handler?: any,
): this;
command(
cmd: string | Array<string>,
@@ -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 = {}) {