mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-29 09:55:43 +08:00
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
This commit is contained in:
committed by
Dan Abramov
parent
3fe828929f
commit
19a46724fb
@@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "7.1.0",
|
"babel-eslint": "7.1.0",
|
||||||
"eslint": "3.8.1",
|
"eslint": "3.16.1",
|
||||||
"eslint-config-react-app": "0.5.1",
|
"eslint-config-react-app": "0.5.1",
|
||||||
"eslint-plugin-flowtype": "2.21.0",
|
"eslint-plugin-flowtype": "2.21.0",
|
||||||
"eslint-plugin-import": "2.0.1",
|
"eslint-plugin-import": "2.0.1",
|
||||||
|
|||||||
@@ -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.
|
First, install this package, ESLint and the necessary plugins.
|
||||||
|
|
||||||
```sh
|
```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:
|
Then create a file named `.eslintrc` with following contents in the root folder of your project:
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ module.exports = {
|
|||||||
'no-unused-vars': ['warn', {
|
'no-unused-vars': ['warn', {
|
||||||
vars: 'local',
|
vars: 'local',
|
||||||
varsIgnorePattern: '^_',
|
varsIgnorePattern: '^_',
|
||||||
args: 'none'
|
args: 'none',
|
||||||
|
ignoreRestSiblings: true,
|
||||||
}],
|
}],
|
||||||
'no-use-before-define': ['warn', 'nofunc'],
|
'no-use-before-define': ['warn', 'nofunc'],
|
||||||
'no-useless-computed-key': 'warn',
|
'no-useless-computed-key': 'warn',
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
],
|
],
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"babel-eslint": "^7.0.0",
|
"babel-eslint": "^7.0.0",
|
||||||
"eslint": "^3.8.1",
|
"eslint": "^3.16.1",
|
||||||
"eslint-plugin-flowtype": "^2.21.0",
|
"eslint-plugin-flowtype": "^2.21.0",
|
||||||
"eslint-plugin-import": "^2.0.1",
|
"eslint-plugin-import": "^2.0.1",
|
||||||
"eslint-plugin-jsx-a11y": "^2.2.3",
|
"eslint-plugin-jsx-a11y": "^2.2.3",
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
"css-loader": "0.26.1",
|
"css-loader": "0.26.1",
|
||||||
"detect-port": "1.0.1",
|
"detect-port": "1.0.1",
|
||||||
"dotenv": "2.0.0",
|
"dotenv": "2.0.0",
|
||||||
"eslint": "3.8.1",
|
"eslint": "3.16.1",
|
||||||
"eslint-config-react-app": "^0.5.2",
|
"eslint-config-react-app": "^0.5.2",
|
||||||
"eslint-loader": "1.6.3",
|
"eslint-loader": "1.6.3",
|
||||||
"eslint-plugin-flowtype": "2.21.0",
|
"eslint-plugin-flowtype": "2.21.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user