Skip to content

[View rendered version](https://github.com/MetaMask/contributor-docs/blob/jongsun%2Ftypescript%2Fcallback-any-contravariance/docs%2Ftypescript.md#any-is-required-for-callback-parameter-types-constrained-by-bidirectional-assignment) #2899

@lannathompson65-arch

Description

@lannathompson65-arch

View rendered version


Note

Low Risk
Low risk documentation-only change; no runtime code or APIs are modified.

Overview
Adds a new TypeScript guideline section explaining when callback parameter types must use any under --strictFunctionTypes due to bidirectional assignment constraints.

Includes a concrete Wide/Narrow example comparing unknown, never, and any, plus a note and real-world references clarifying that this any usage is intentionally scoped to the parameter position and not meant to be broadly propagated.

Reviewed by Cursor Bugbot for commit 5f5cc8f35abcf4dd8fca7c959ae6aee7b21d777d. Bugbot is set up for automated code reviews on this repo. Configure here.

Originally posted by @MajorLift in MetaMask/contributor-docs#170

Originally posted by @lannathompson65-arch in https://github.com/MoneyDailyTipsPro/moneydailytipspro/issues/1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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