Skip to content

follow-up: CommandContext.outputResult field type still uses any, not widened to object #2048

Description

@carlos-alm

Noticed while resolving merge conflicts on PR #1933 ("refactor: widen outputResult signature, remove redundant casts at call sites").

Context: #1933 widens the real outputResult function (src/presentation/result-formatter.ts) from data: Record<string, any> to data: object. CommandContext.outputResult in src/types.ts (the DI-shape type used to pass outputResult into CLI commands) still types its data parameter as any, predating this PR — confirmed already present on #1933's own branch tip before any conflict resolution touched the file, so this isn't something the merge introduced.

Not a functional bug: an any-typed parameter is structurally compatible with any narrower type, so no type error results. Purely a documentation/consistency gap — the CommandContext interface's field type doesn't reflect the real function's now-narrower signature.

Fix: change outputResult: (data: any, key: string, opts: any) => boolean; to outputResult: (data: object, key: string, opts: any) => boolean; (or reuse whatever named parameter type the real function now uses) in src/types.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upDeferred work from PR reviews that needs tracking

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions