diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index fa803d9bd4..96e6152860 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -10,9 +10,9 @@ module.exports = { 'rules': { // Prevent missing displayName in a React component definition // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md - 'react/display-name': 0, + 'react/display-name': [0, {'acceptTranspilerName', false}], // Forbid certain propTypes (any, array, object) - 'react/forbid-prop-types': 0, + 'react/forbid-prop-types': [0, {'forbid': ['any', 'array', 'object']}], // Enforce boolean attributes notation in JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md 'react/jsx-boolean-value': [2, 'never'], @@ -21,17 +21,17 @@ module.exports = { 'react/jsx-closing-bracket-location': [2, 'line-aligned'], // Enforce or disallow spaces inside of curly braces in JSX attributes // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md - 'react/jsx-curly-spacing': 0, + 'react/jsx-curly-spacing': [0, 'never', {'allowMultiline': true}], // Validate props indentation in JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md 'react/jsx-indent-props': [2, 2], // Limit maximum of props on a single line in JSX - 'react/jsx-max-props-per-line': 0, + 'react/jsx-max-props-per-line': [0, {'maximum': 1}], // Prevent usage of .bind() and arrow functions in JSX props 'react/jsx-no-bind': 0, // Prevent duplicate props in JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md - 'react/jsx-no-duplicate-props': 0, + 'react/jsx-no-duplicate-props': [0, {'ignoreCase': false}], // Prevent usage of unwrapped JSX strings 'react/jsx-no-literals': 0, // Disallow undeclared variables in JSX @@ -39,10 +39,16 @@ module.exports = { 'react/jsx-no-undef': 2, // Enforce propTypes declarations alphabetical sorting // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-prop-types.md - 'react/jsx-sort-prop-types': 0, + 'react/jsx-sort-prop-types': [0, { + 'ignoreCase': false, + 'callbacksLast': false, + }], // Enforce props alphabetical sorting // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md - 'react/jsx-sort-props': 0, + 'react/jsx-sort-props': [0, { + 'ignoreCase': false, + 'callbacksLast': false, + }], // Prevent React to be incorrectly marked as unused // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md 'react/jsx-uses-react': [2, {'pragma': 'React'}], @@ -82,7 +88,7 @@ module.exports = { 'react/react-in-jsx-scope': 2, // Restrict file extensions that may be required // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md - 'react/require-extension': 0, + 'react/require-extension': [0, {'extensions': ['.jsx']}], // Prevent extra closing tags for components without children // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md 'react/self-closing-comp': 2,