Skip to content

Commit 0a89f3d

Browse files
authored
docs(readme): explain babel-parser (#44)
1 parent de867d9 commit 0a89f3d

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,30 @@ Note that the `eslint-config-` portion of the module name is assumed by ESLint.
3131

3232
### Local
3333

34-
A specific project can extend this definition by including `eslint eslint-config-fullstack eslint-plugin-react` as saved dev-dependencies, and a local `.eslintrc.json` which `{ "extends": "fullstack" }`.
34+
A specific project can extend this definition by including `eslint eslint-config-fullstack eslint-plugin-react` as saved dev-dependencies, and defining a local `.eslintrc.json`. Project-level eslintrc files are recommended to be set as `root`, which prevents users' global configs from producing inconsistent results:
35+
36+
```json
37+
{
38+
"extends": "fullstack",
39+
"root": true
40+
}
41+
```
42+
43+
### For Babel-Transpiled Projects
44+
45+
This config's peer dependencies (eslint, eslint-plugin-react) enable linting relatively modern files including JSX components. If you find that the linter fails to understand some early-stage ES features, you can enable parsing using Babel instead of ESLint's default parser. Install `babel-eslint` and set the `parser` option of your config:
46+
47+
```sh
48+
npm install babel-eslint --save-dev
49+
```
50+
51+
```json
52+
{
53+
"parser": "babel-eslint",
54+
"extends": "fullstack",
55+
"root": true
56+
}
57+
```
3558

3659
## Extending
3760

0 commit comments

Comments
 (0)