jsx-eslint/eslint-plugin-react

Create a new rule or update jsx-no-bind to work with react hooks and jsx

Open

#2,901 创建于 2021年1月13日

在 GitHub 查看
 (13 评论) (0 反应) (0 负责人)JavaScript (8,630 star) (2,797 fork)batch import
help wantednew rule

描述

I am looking for a lint rule that helps me enforce not declaring inline functions (function type is irrelevant) inside jsx code. React hooks don't need binding anymore soo... i'm not sure if including this inside jsx-no-bind would be fair..

React Native basic example below: Screen Shot 2021-01-13 at 20 01 31

This is a something profiling nerds need and I a recommended way of handling functions when jsx is concerned. One possible option available could be to allow one liners to still exist (but i don't see a reason why other than laziness).

贡献者指南