mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-25 21:55:42 +08:00
Update eslint instructions in docs (#5990)
This commit is contained in:
@@ -19,9 +19,9 @@ Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plug
|
||||
|
||||
They are not required for linting. You should see the linter output right in your terminal as well as the browser console. However, if you prefer the lint results to appear right in your editor, there are some extra steps you can do.
|
||||
|
||||
You would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc` to the project root:
|
||||
You would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc.json` to the project root:
|
||||
|
||||
```js
|
||||
```json
|
||||
{
|
||||
"extends": "react-app"
|
||||
}
|
||||
@@ -29,7 +29,7 @@ You would need to install an ESLint plugin for your editor first. Then, add a fi
|
||||
|
||||
Now your editor should report the linting warnings.
|
||||
|
||||
Note that even if you edit your `.eslintrc` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.
|
||||
Note that even if you edit your `.eslintrc.json` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.
|
||||
|
||||
If you want to enforce a coding style for your project, consider using [Prettier](https://github.com/jlongster/prettier) instead of ESLint style rules.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user