Closed kettanaito closed 7 years ago
Ad 1. it tells you that class method is pointless when you don’t need this
and that you can use plain function instead.
Ad 2. that would help in case of componentDidMount
etc. but once you need custom renderSomething()
methods, it’s useless.
I like the hint that you shouldn’t overuse class methods when not needed. But writing render helpers outside of React classes seems weird to me as well.
So I don’t really know at the moment.
cc @janpanschab
Support for exceptMethod
has been added
Let’s try it and close the issue.
A rule
class-methods-use-this
is buggy regarding React Components (as noticed by @ronaldruzicka ), and also here.Possible solutions:
exceptMethods
option for this rule, as mentioned here, to make it ignore React methods until they are properly parsed.