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

Aberta
#59,941 2 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

@dkarlovi já está trabalhando nisso.

Desde 11/11/2026.

  • #59943 de @dkarlovi — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
25/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
javascript, react-native, typescript

Direção de pesquisa

Start with Libraries/Animated/Easing.js and inspect the generated declaration at types_generated/Libraries/Animated/Easing.d.ts. Confirm the declarations expose the easing functions as properties with function types, then run the reproducer's ESLint command to check that passing Easing.cubic no longer triggers @typescript-eslint/unbound-method. An open pull request, #59943, is already linked to this issue.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Needs: Attention Needs: Repro
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

Linguagem predominante
C++
Estrelas
127k
Forks
25.5k
Merge médio
3d 22h
PRs com merge (30d)
235

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de react/react-native

Todas as issues de react/react-native

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.