Skip to content

Easing functions are typed as methods, so passing them trips @typescript-eslint/unbound-method #59941

Open

Description

@dkarlovi

Description

Libraries/Animated/Easing.js declares linear, ease, cubic etc. with method shorthand, so types_generated/Libraries/Animated/Easing.d.ts emits cubic(t: number): number;. None of them reads this, and the documented usage passes them unbound (easing: Easing.cubic), which fails typescript-eslint's recommendedTypeChecked (@typescript-eslint/unbound-method).

Fix: declare them as arrow-function properties, so the types become cubic: (t: number) => number.

Steps to reproduce

  1. Clone the reproducer gist.
  2. npm install --ignore-scripts
  3. npx eslint index.ts

React Native Version

0.88.1

Affected Platforms

Other (type definitions)

Output of npx @react-native-community/cli info

Not applicable: type definitions only, no app.

Stacktrace or Logs

4:46  error  A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object  @typescript-eslint/unbound-method

MANDATORY Reproducer

https://gist.github.com/dkarlovi/4c0a3edcec5fab42be4aec8eb6ff1d80

Screenshots and Videos

No response

Activity

  1. react-native-bot commented on Nov 11, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

  2. dkarlovi commented on Nov 11, 2026

    @dkarlovi
    Author

    Fix with test plan: #59943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions