You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: packages/react-scripts/template/README.md
+6-32
Original file line number
Diff line number
Diff line change
@@ -207,50 +207,24 @@ To configure the syntax highlighting in your favorite text editor, head to the [
207
207
208
208
## Displaying Lint Output in the Editor
209
209
210
-
>Note: this feature is available with `[email protected]` and higher.
210
+
>Note: this feature is available with `[email protected]` and higher.
211
+
>It also only works with npm 3 or higher.
211
212
212
213
Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
213
214
214
215
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.
215
216
216
-
You would need to install an ESLint plugin for your editor first.
217
-
218
-
>**A note for Atom `linter-eslint` users**
219
-
220
-
>If you are using the Atom `linter-eslint` plugin, make sure that **Use global ESLint installation** option is checked:
>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:
228
-
229
-
>```js
230
-
>{
231
-
>// ...
232
-
>"extends":"react-app"
233
-
>}
234
-
>```
235
-
236
-
Then add this block to the `package.json` file of your project:
217
+
You would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc` to the project root:
237
218
238
219
```js
239
220
{
240
-
// ...
241
-
"eslintConfig": {
242
-
"extends":"react-app"
243
-
}
221
+
"extends":"react-app"
244
222
}
245
223
```
246
224
247
-
Finally, you will need to install some packages *globally*:
Now your editor should report the linting warnings.
252
226
253
-
We recognize that this is suboptimal, but it is currently required due to the way we hide the ESLint dependency. The ESLint team is already [working on a solution to this](https://github.com/eslint/eslint/issues/3458) so this may become unnecessary in a couple of months.
227
+
Note that even if you edit your `.eslintrc` file further, these changes 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.
0 commit comments