jsx-eslint/eslint-plugin-react

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

Open

#2901 opened on Jan 13, 2021

View on GitHub
 (13 comments) (0 reactions) (0 assignees)JavaScript (8,630 stars) (2,797 forks)batch import
help wantednew rule

Description

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).

Contributor guide