Document how to add linting in an editor

This commit is contained in:
Dan Abramov
2016-07-26 15:08:25 +01:00
committed by GitHub
parent 9a4e9678ad
commit 4ca7b0da06

View File

@@ -219,6 +219,30 @@ Please be advised that this is also a custom feature of Webpack.
**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.
### Display Lint Output in the Editor
>Note: this feature is available with `react-scripts@0.2.0` and higher.
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:
```js
{
// ...
"eslintConfig": {
"extends": "./node_modules/react-scripts/config/eslint.js"
}
}
```
Projects generated with `react-scripts@0.2.0` and higher should already have it.
There are two limitations:
* This only works with npm >= 3 because of [an ESLint issue](https://github.com/eslint/eslint/issues/3458).
* You cant delete these lines. We dont like configuration as much as you do, and [are looking for better solutions](https://github.com/facebookincubator/create-react-app/issues/215).
If you dont need ESLint integration with your editor, you can safely delete those three lines from your `package.json`.
### Add Flow
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
### Deploy to GitHub Pages
>Note: this feature is available with `react-scripts@0.2.0` and higher.
First, open your `package.json` and add a `homepage` field.
It could look like this: