eslint-plugin-react
eslint-plugin-react copied to clipboard
New rule: Report usages of class methods besides render returning JSX
I saw #578 and thought that the requested rule was useful. I personally don't like components that define extra render* methods that return JSX. It is a way to clean up the main render method, but the better choice is to move the logic to separate components. This rule will try to enforce that.
I wasn't sure about the rule name, so I'm open to a better name if it's offered.
Closes #578
I like this rule also.
For reference, I have a PR that adds similar functionality to the existing prefer-stateless-function
rule, but there were a few cases that I didn't manage to catch: https://github.com/yannickcr/eslint-plugin-react/pull/1313