Skip to content

Commit d071aa0

Browse files
authored
Add some clarifications to the howto
1 parent d564a9c commit d071aa0

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

template/README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ You need to **put any JS and CSS files inside `src`**, or Webpack won’t see th
3838
You can, however, create more top-level directories.
3939
They will not be included in the production build so you can use them for things like documentation.
4040

41+
>**Known Issue:**
42+
>
43+
>You may encounter an issue where changing a file inside `src` doesn’t trigger a recompilation. Most likely this happens because the path in your filesystem differs in its casing from the path you imported. For example, if a file is called `App.js` but you are importing `app.js`, the watcher might not recognize changes to it. We are [considering](https://github.com/facebookincubator/create-react-app/issues/240) enforcing some checks to prevent this. If this doesn’t help, check out the page on [troubleshooting watching](https://webpack.github.io/docs/troubleshooting.html#watching).
44+
4145
## Available Scripts
4246

4347
In the project directory, you can run:
@@ -203,7 +207,7 @@ Here is an example:
203207
import React from 'react';
204208
import logo from './logo.png'; // Tell Webpack this JS file uses this image
205209

206-
console.log(logo); // /84287d09b8053c6fa598893b8910786a.png
210+
console.log(logo); // /logo.84287d09.png
207211

208212
function Header() {
209213
// Import result is the URL of your image
@@ -231,7 +235,12 @@ Please be advised that this is also a custom feature of Webpack.
231235

232236
>Note: this feature is available with `react-scripts@0.2.0` and higher.
233237
234-
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:
238+
Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
239+
240+
They are not required for linting. You should still 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.
241+
242+
You would need to install an ESLint plugin for your editor first.
243+
Then make sure `package.json` of your project ends with this block:
235244

236245
```js
237246
{
@@ -242,14 +251,16 @@ Some editors, including Sublime Text and Atom, provide plugins for ESLint. You w
242251
}
243252
```
244253

245-
Projects generated with `react-scripts@0.2.0` and higher should already have it.
254+
Projects generated with `react-scripts@0.2.0` and higher should already have it.
255+
If you don’t need ESLint integration with your editor, you can safely delete those three lines from your `package.json`.
246256

247-
There are two limitations:
257+
Finally, you will need to install some packages *globally*:
248258

249-
* This only works with npm >= 3 because of [an ESLint issue](https://github.com/eslint/eslint/issues/3458).
250-
* 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).
259+
```sh
260+
npm install -g eslint babel-eslint eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y
261+
```
251262

252-
If you don’t need ESLint integration with your editor, you can safely delete those three lines from your `package.json`.
263+
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.
253264

254265
### Add Flow
255266

0 commit comments

Comments
 (0)