Skip to content

Commit 4ca7b0d

Browse files
authored
Document how to add linting in an editor
1 parent 9a4e967 commit 4ca7b0d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

template/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,30 @@ Please be advised that this is also a custom feature of Webpack.
219219

220220
**It is not required for React** but many people enjoy it (and React Native uses a similar mechanism for images). However it may not be portable to some other environments, such as Node.js and Browserify. If you prefer to reference static assets in a more traditional way outside the module system, please let us know [in this issue](https://github.com/facebookincubator/create-react-app/issues/28), and we will consider support for this.
221221

222+
### Display Lint Output in the Editor
223+
224+
>Note: this feature is available with `[email protected]` and higher.
225+
226+
Some editors, including Sublime Text and Atom, provide plugins for ESLint. You would need to install such a plugin first. Once you install and enable an ESLint plugin for your editor, make sure `package.json` of your project ends with this block:
227+
228+
```js
229+
{
230+
// ...
231+
"eslintConfig": {
232+
"extends": "./node_modules/react-scripts/config/eslint.js"
233+
}
234+
}
235+
```
236+
237+
Projects generated with `[email protected]` and higher should already have it.
238+
239+
There are two limitations:
240+
241+
* This only works with npm >= 3 because of [an ESLint issue](https://github.com/eslint/eslint/issues/3458).
242+
* You can’t delete these lines. We don’t like configuration as much as you do, and [are looking for better solutions](https://github.com/facebookincubator/create-react-app/issues/215).
243+
244+
If you don’t need ESLint integration with your editor, you can safely delete those three lines from your `package.json`.
245+
222246
### Add Flow
223247

224248
Flow typing is currently [not supported out of the box](https://github.com/facebookincubator/create-react-app/issues/72) with the default `.flowconfig` generated by Flow. If you run it, you might get errors like this:
@@ -277,6 +301,8 @@ We will consider integrating more tightly with Flow in the future so that you do
277301

278302
### Deploy to GitHub Pages
279303

304+
>Note: this feature is available with `[email protected]` and higher.
305+
280306
First, open your `package.json` and add a `homepage` field.
281307
It could look like this:
282308

0 commit comments

Comments
 (0)