Repository: airbnb/javascript
File: packages/eslint-config-airbnb/rules/react.js (JavaScript)

Code before:
    'react/no-this-in-sfc': 'error',

    // Validate JSX maximum depth
    // https://github.com/yannickcr/eslint-plugin-react/blob/abe8381c0d6748047224c430ce47f02e40160ed0/docs/rules/jsx-max-depth.md
    'react/jsx-max-depth': 'off',

    // Disallow multiple spaces between inline JSX props
    // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-props-no-multi-spaces.md
    'react/jsx-props-no-multi-spaces': 'error',

    // Prevent usage of UNSAFE_ methods
    // https://github.com/yannickcr/eslint-plugin-react/blob/157cc932be2cfaa56b3f5b45df6f6d4322a2f660/docs/rules/no-unsafe.md
    'react/no-unsafe': 'off',

    // Enforce shorthand or standard form for React fragments
    // https://github.com/yannickcr/eslint-plugin-react/blob/bc976b837abeab1dffd90ac6168b746a83fc83cc/docs/rules/jsx-fragments.md
    // TODO: enable, semver-major
    'react/jsx-fragments': ['off', 'syntax'],

    // Enforce Rules of Hooks
    // https://github.com/facebook/react/blob/f99fca3cb28e1fbd87e0b647ac43959add290be7/packages/eslint-plugin-react-hooks/README.md
    'react-hooks/rules-of-hooks': 'error',

    // Verify the list of the dependencies for Hooks like useEffect and similar
    // https://github.com/facebook/react/blob/f99fca3cb28e1fbd87e0b647ac43959add290be7/packages/eslint-plugin-react-hooks/README.md
    'react-hooks/exhaustive-deps': 'error',
  },

  settings: {
    'import/resolver': {
      node: {
        extensions: ['.js', '.jsx', '.json']
      }
    },
    react: {
      pragma: 'React',
      version: '16.0'
    },
    propWrapperFunctions: [
      'forbidExtraProps', // https://www.npmjs.com/package/airbnb-prop-types
      'exact', // https://www.npmjs.com/package/prop-types-exact
      'Object.freeze', // https://tc39.github.io/ecma262/#sec-object.freeze
    ],
  }
};


Review comment (suggestion):
This is likely to cause errors in existing codebases so it's definitely a breaking change.

Let me know if it should be switched to `'warn'`, or `'off'` with a semver-major todo comment.

Code after:

    // Validate JSX maximum depth
    // https://github.com/yannickcr/eslint-plugin-react/blob/abe8381c0d6748047224c430ce47f02e40160ed0/docs/rules/jsx-max-depth.md
    'react/jsx-max-depth': 'off',

    // Disallow multiple spaces between inline JSX props
    // https://github.com/yannickcr/eslint-plugin-react/blob/ac102885765be5ff37847a871f239c6703e1c7cc/docs/rules/jsx-props-no-multi-spaces.md
    'react/jsx-props-no-multi-spaces': 'error',

    // Prevent usage of UNSAFE_ methods
    // https://github.com/yannickcr/eslint-plugin-react/blob/157cc932be2cfaa56b3f5b45df6f6d4322a2f660/docs/rules/no-unsafe.md
    'react/no-unsafe': 'off',

    // Enforce shorthand or standard form for React fragments
    // https://github.com/yannickcr/eslint-plugin-react/blob/bc976b837abeab1dffd90ac6168b746a83fc83cc/docs/rules/jsx-fragments.md
    // TODO: enable, semver-major
    'react/jsx-fragments': ['off', 'syntax'],

    // Enforce linebreaks in curly braces in JSX attributes and expressions.
    // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-newline.md
    // TODO: enable, semver-minor
    'react/jsx-curly-newline': ['off', {
      multiline: 'consistent',
      single: 'consistent',
    }],

    // Enforce state initialization style
    // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/state-in-constructor.md
    // TODO: enable, semver-minor
    // TODO: set to "always" once babel-preset-airbnb supports public class fields
    'react/state-in-constructor': ['off', 'never'],

    // Enforces where React component static properties should be positioned
    // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/static-property-placement.md
    // TODO: enable, semver-minor
    // TODO: set to "static public field" once babel-preset-airbnb supports public class fields
    'react/static-property-placement': ['off', 'property assignment'],

    // Disallow JSX props spreading
    // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-spreading.md
    // TODO: enable, semver-major
    'react/jsx-props-no-spreading': ['off', {
      html: 'enforce',
      custom: 'enforce',
      exceptions: [],
    }],

    // Enforce that props are read-only
    // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-read-only-props.md
    'react/prefer-read-only-props': 'off',
  },