From 0c6de54acde6e73ee108fb8110cea0624c9211dd Mon Sep 17 00:00:00 2001 From: vulong23 Date: Sat, 4 Feb 2017 19:05:59 +0700 Subject: [PATCH 1/2] Add ESLint config for VS Code users --- packages/react-scripts/template/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index 0eb5cda3840..e3a47f6bc8f 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -185,6 +185,20 @@ You would need to install an ESLint plugin for your editor first. > + +>**For VS Code users** + +>Because VS Code ESLint plugin requires you to create your own ESLint configuration file at the root directory, you have to also include `eslint-config-react-app` in it. + +>Add this line to `./.eslintrc.json`: + +>```js +{ + // ... + "extends": "react-app" +} +``` + Then add this block to the `package.json` file of your project: ```js From 41f35da8d41a72803dd68a29a179d455f23fd88b Mon Sep 17 00:00:00 2001 From: vulong23 Date: Sat, 4 Feb 2017 23:42:06 +0700 Subject: [PATCH 2/2] Update VSC ESLint note to a better solution Update VSC ESLint note to a better solution as discussed in Pull Request --- packages/react-scripts/template/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/react-scripts/template/README.md b/packages/react-scripts/template/README.md index e3a47f6bc8f..a302702d73e 100644 --- a/packages/react-scripts/template/README.md +++ b/packages/react-scripts/template/README.md @@ -186,11 +186,9 @@ You would need to install an ESLint plugin for your editor first. > ->**For VS Code users** +>**For Visual Studio Code users** ->Because VS Code ESLint plugin requires you to create your own ESLint configuration file at the root directory, you have to also include `eslint-config-react-app` in it. - ->Add this line to `./.eslintrc.json`: +>VS Code ESLint plugin automatically detects Create React App's configuration file. So you do not need to create `eslintrc.json` at the root directory, except when you want to add your own rules. In that case, you should include CRA's config by adding this line: >```js {