Easing functions are typed as methods, so passing them trips @typescript-eslint/unbound-method
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- javascript, react-native, typescript
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- Clone the reproducer gist.
npm install --ignore-scriptsnpx 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
- 主要语言
- C++
- 星标
- 127k
- 派生
- 25.5k
- 平均合并
- 3 天 22 小时
- 30 天内合并 PR
- 235
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
react/react-native 的其他 Issue
-
Needs: Author Feedback Needs: Repro
难度 2/5 1-3 小时 新手友好度 82/100
react/react-native#60059 · 1 条评论 ·
维护者通常 2 天内回复
-
Needs: Triage :mag:
难度 2/5 1-3 小时 新手友好度 70/100
react/react-native#60000 ·
维护者通常 2 天内回复
-
`yarn test-ios` exits before building RNTester: `objc-test.sh` launches the WebSocket server script #59433 deleted可能已有人在做 @lazerg 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
react/react-native#59939 ·
维护者通常 2 天内回复
-
iOS Fabric pointer-handler reset leaves the next lone touch non-primary可能已有人在做 @alleneubank 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
react/react-native#59919 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
react/react-native#59722 ·
维护者通常 2 天内回复
查看 react/react-native 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
petercorke/robotics-toolbox-python#943 · 1 条评论 ·
维护者通常 1 天内回复
-
area:build bug
难度 1/5 1 小时以内 新手友好度 90/100
NatronGitHub/openfx-arena#71 ·
维护者通常 1 天内回复
-
upstream-blocked
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ROCm/FastFlowLM#1057 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
NatronGitHub/openfx-gmic#45 ·
维护者通常 1 天内回复