interactivethings / eslint-config-interactivethings

The Interactive Things ESLint config
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Warn on `setState` #3

Closed grossbart closed 9 years ago

grossbart commented 9 years ago

Version 3.3.0 of ESLint supports warning on setState.

https://github.com/yannickcr/eslint-plugin-react/pull/197

tpreusse commented 9 years ago

Not too big of a fan of enabling this – I like saving e.g. calculated layouts in state (on will mount and will update) – stuff that I explicitly don't want to propagate up. Of course I could disable the rule for those dumb components but ESLint rules tend to make you adapt your style and avoid features it doesn't like.

jstcki commented 9 years ago

I'm also against this. This will become even less relevant once React supports pure functions as components (which don't have setState).