From 0f910e0740ace0707bc2da24cc5f2954f4e0238b Mon Sep 17 00:00:00 2001 From: Emmanuel Chambon Date: Wed, 16 Feb 2022 13:46:10 +0100 Subject: [PATCH] feat(eslint-config-react): enforce class fields for react class --- packages/eslint-config-react/shared.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/eslint-config-react/shared.js b/packages/eslint-config-react/shared.js index 837f05304..db5aa7b0c 100644 --- a/packages/eslint-config-react/shared.js +++ b/packages/eslint-config-react/shared.js @@ -61,6 +61,10 @@ module.exports = { 'react/no-adjacent-inline-elements': 'error', // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-adjacent-inline-elements.md 'prefer-object-has-own': 'error', // https://eslint.org/docs/rules/prefer-object-has-own + // We don't use babel-preset-airbnb so we can make those changes + 'react/static-property-placement': ['error', 'static public field'], + 'react/state-in-constructor': ['error', 'never'], + // To have consistent ordering in proptypes 'react/sort-prop-types': [ // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-prop-types.md