Eslint-plugin-react: Does "react/state-in-constructor" still make sense?

Created on 4 May 2019  路  5Comments  路  Source: yannickcr/eslint-plugin-react

Does "react/state-in-constructor" still make sense?

question

All 5 comments

It was only added last fall, so of course? It will forever make sense to me. Why do you think it wouldn鈥檛?

Yes, but with https://github.com/yannickcr/eslint-plugin-react/commit/a312b16ea41203fc02054308f590f0e65784e2c3 is active in my projects. So until now it was turned off.

I think the default way should be without constructor anyway. What do you think?

It should not, because class fields isn't part of the language yet - it's stage 3.

Ok. You're right, as always. I'm using babel, so. Thanks anyway. For me we can close.

Even when it's in the language, folks may still have a style preference, so the rule won't stop making sense at any point.

Was this page helpful?
0 / 5 - 0 ratings