From bbbabf32f811dd8989e27cec4fbcc18025d9a515 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 19 Feb 2017 16:51:19 -0800 Subject: [PATCH] [eslint config] [deps] update `eslint-plugin-react` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - semver-patch: `jsx-max-props-per-line` “when” set to “multiline”, but left off for now. --- packages/eslint-config-airbnb/package.json | 4 ++-- packages/eslint-config-airbnb/rules/react.js | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/eslint-config-airbnb/package.json b/packages/eslint-config-airbnb/package.json index 2ef0d65c..51e0877b 100644 --- a/packages/eslint-config-airbnb/package.json +++ b/packages/eslint-config-airbnb/package.json @@ -56,7 +56,7 @@ "eslint-find-rules": "^1.14.3", "eslint-plugin-import": "^2.2.0", "eslint-plugin-jsx-a11y": "^4.0.0", - "eslint-plugin-react": "^6.9.0", + "eslint-plugin-react": "^6.10.0", "in-publish": "^2.0.0", "react": ">= 0.13.0", "safe-publish-latest": "^1.1.1", @@ -66,7 +66,7 @@ "eslint": "^3.15.0", "eslint-plugin-jsx-a11y": "^4.0.0", "eslint-plugin-import": "^2.2.0", - "eslint-plugin-react": "^6.9.0" + "eslint-plugin-react": "^6.10.0" }, "engines": { "node": ">= 4" diff --git a/packages/eslint-config-airbnb/rules/react.js b/packages/eslint-config-airbnb/rules/react.js index ad717eab..407bf8fc 100644 --- a/packages/eslint-config-airbnb/rules/react.js +++ b/packages/eslint-config-airbnb/rules/react.js @@ -71,7 +71,8 @@ module.exports = { // Limit maximum of props on a single line in JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-max-props-per-line.md - 'react/jsx-max-props-per-line': ['off', { maximum: 1 }], + // TODO: enable (semver-minor) + 'react/jsx-max-props-per-line': ['off', { maximum: 1, when: 'multiline' }], // Prevent usage of .bind() in JSX props // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-bind.md @@ -118,6 +119,7 @@ module.exports = { callbacksLast: false, shorthandFirst: false, shorthandLast: false, + noSortAlphabetically: false, }], // Prevent React to be incorrectly marked as unused @@ -178,7 +180,7 @@ module.exports = { // Prevent missing props validation in a React component definition // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md - 'react/prop-types': ['error', { ignore: [], customValidators: [] }], + 'react/prop-types': ['error', { ignore: [], customValidators: [], skipUndeclared: false }], // Prevent missing React when using JSX // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md @@ -304,6 +306,20 @@ module.exports = { // Enforce a defaultProps definition for every prop that is not a required prop // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md 'react/require-default-props': 'error', + + 'react/forbid-elements': ['off', { + forbid: [ + ], + }], + + // Forbids using non-exported propTypes + // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-foreign-prop-types.md + 'react/forbid-foreign-prop-types': 'off', + + // Prevent void DOM elements from receiving children + // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md + // TODO: enable (semver-minor) + 'react/void-dom-elements-no-children': 'off', }, settings: {