From 9f0b53a39f1279fd523fb190b2bb653157a61009 Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Fri, 4 Jan 2019 23:39:07 -0800 Subject: [PATCH 1/3] Bump eslint-plugin-react version and update webpack config --- packages/react-scripts/config/webpack.config.js | 2 +- packages/react-scripts/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 3696597fb44..02033d5d937 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -314,7 +314,7 @@ module.exports = function(webpackEnv) { // @remove-on-eject-begin baseConfig: { extends: [require.resolve('eslint-config-react-app')], - settings: { react: { version: '999.999.999' } }, + settings: { react: { version: 'detect' } }, }, ignore: false, useEslintrc: false, diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index c19236b9fc7..7147acd5f15 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -44,7 +44,7 @@ "eslint-plugin-flowtype": "2.50.1", "eslint-plugin-import": "2.14.0", "eslint-plugin-jsx-a11y": "6.1.2", - "eslint-plugin-react": "7.11.1", + "eslint-plugin-react": "7.12.3", "file-loader": "2.0.0", "fork-ts-checker-webpack-plugin-alt": "0.4.14", "fs-extra": "7.0.0", From b57158a605c4ef777f38183a85c875803dd3315c Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Sun, 6 Jan 2019 12:44:05 -0800 Subject: [PATCH 2/3] Move eslint-plugin-react settings into eslint-config-react-app --- packages/eslint-config-react-app/index.js | 6 ++++++ packages/react-scripts/config/webpack.config.js | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index ca232b879ec..236f97fc623 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -46,6 +46,12 @@ module.exports = { }, }, + settings: { + react: { + version: 'detect', + }, + }, + rules: { // http://eslint.org/docs/rules/ 'array-callback-return': 'warn', diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 02033d5d937..7699d2cb040 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -314,7 +314,6 @@ module.exports = function(webpackEnv) { // @remove-on-eject-begin baseConfig: { extends: [require.resolve('eslint-config-react-app')], - settings: { react: { version: 'detect' } }, }, ignore: false, useEslintrc: false, From 71ea00fa56a7046bed21a4914652bc8a757be166 Mon Sep 17 00:00:00 2001 From: Ian Schmitz Date: Sun, 6 Jan 2019 14:20:21 -0800 Subject: [PATCH 3/3] Add react/no-typos rule --- packages/eslint-config-react-app/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index 236f97fc623..f83ed06a104 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -211,6 +211,7 @@ module.exports = { // 'react/no-deprecated': 'warn', 'react/no-direct-mutation-state': 'warn', 'react/no-is-mounted': 'warn', + 'react/no-typos': 'error', 'react/react-in-jsx-scope': 'error', 'react/require-render-return': 'error', 'react/style-prop-object': 'warn',