From 474af9ea71ac04a613fcd4d8bf0b5827a3916356 Mon Sep 17 00:00:00 2001 From: Chris Drackett Date: Sun, 5 Mar 2017 06:54:33 -0800 Subject: [PATCH] Add support for ignoreRestSiblings in no-unused-vars (#1705) * updating eslint to 3.16.1 * add support for ignoreRestSiblings in eslint http://eslint.org/docs/rules/no-unused-vars#ignorerestsiblings * updating eslint to 3.16.1 in `react-scripts` * updating eslint * missing `^` * missing ^ * pinning main eslint and updating readme * Pin ESLint version --- package.json | 14 +++++++------- packages/eslint-config-react-app/README.md | 2 +- packages/eslint-config-react-app/index.js | 3 ++- packages/eslint-config-react-app/package.json | 2 +- packages/react-scripts/package.json | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 6f53382a2c3..2532d407118 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,13 @@ "test": "node packages/react-scripts/scripts/test.js --env=jsdom" }, "devDependencies": { - "babel-eslint": "6.1.2", - "eslint": "3.5.0", - "eslint-config-react-app": "0.2.1", - "eslint-plugin-flowtype": "2.18.1", - "eslint-plugin-import": "1.12.0", - "eslint-plugin-jsx-a11y": "2.2.2", - "eslint-plugin-react": "6.3.0", + "babel-eslint": "7.1.0", + "eslint": "3.16.1", + "eslint-config-react-app": "0.5.1", + "eslint-plugin-flowtype": "2.21.0", + "eslint-plugin-import": "2.0.1", + "eslint-plugin-jsx-a11y": "2.2.3", + "eslint-plugin-react": "6.4.1", "lerna": "2.0.0-beta.38", "lerna-changelog": "^0.2.3" } diff --git a/packages/eslint-config-react-app/README.md b/packages/eslint-config-react-app/README.md index 4d967afb806..45cdfe99be2 100644 --- a/packages/eslint-config-react-app/README.md +++ b/packages/eslint-config-react-app/README.md @@ -17,7 +17,7 @@ If you want to use this ESLint configuration in a project not built with Create First, install this package, ESLint and the necessary plugins. ```sh - npm install --save-dev eslint-config-react-app babel-eslint@7.0.0 eslint@3.8.1 eslint-plugin-flowtype@2.21.0 eslint-plugin-import@2.0.1 eslint-plugin-jsx-a11y@2.2.3 eslint-plugin-react@6.4.1 + npm install --save-dev eslint-config-react-app babel-eslint@7.0.0 eslint@3.16.1 eslint-plugin-flowtype@2.21.0 eslint-plugin-import@2.0.1 eslint-plugin-jsx-a11y@2.2.3 eslint-plugin-react@6.4.1 ``` Then create a file named `.eslintrc` with following contents in the root folder of your project: diff --git a/packages/eslint-config-react-app/index.js b/packages/eslint-config-react-app/index.js index d93478bc8c9..dc111c991ed 100644 --- a/packages/eslint-config-react-app/index.js +++ b/packages/eslint-config-react-app/index.js @@ -133,7 +133,8 @@ module.exports = { 'no-unused-vars': ['warn', { vars: 'local', varsIgnorePattern: '^_', - args: 'none' + args: 'none', + ignoreRestSiblings: true, }], 'no-use-before-define': ['warn', 'nofunc'], 'no-useless-computed-key': 'warn', diff --git a/packages/eslint-config-react-app/package.json b/packages/eslint-config-react-app/package.json index 344cd4a0214..6e15a7b472f 100644 --- a/packages/eslint-config-react-app/package.json +++ b/packages/eslint-config-react-app/package.json @@ -12,7 +12,7 @@ ], "peerDependencies": { "babel-eslint": "^7.0.0", - "eslint": "^3.8.1", + "eslint": "^3.16.1", "eslint-plugin-flowtype": "^2.21.0", "eslint-plugin-import": "^2.0.1", "eslint-plugin-jsx-a11y": "^2.2.3", diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index bc0af16d481..2db2677978c 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -37,7 +37,7 @@ "css-loader": "0.26.1", "detect-port": "1.0.1", "dotenv": "2.0.0", - "eslint": "3.8.1", + "eslint": "3.16.1", "eslint-config-react-app": "^0.5.2", "eslint-loader": "1.6.0", "eslint-plugin-flowtype": "2.21.0",