From 4ca7b0da0626318e68d68c74518ea24abc14bc5c Mon Sep 17 00:00:00 2001 From: Dan Abramov <dan.abramov@gmail.com> Date: Tue, 26 Jul 2016 15:08:25 +0100 Subject: [PATCH] Document how to add linting in an editor --- template/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/template/README.md b/template/README.md index 0320f734d..42584ce5a 100644 --- a/template/README.md +++ b/template/README.md @@ -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 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). + +If you don’t 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: -- GitLab