Skip to content

Commit 6a05137

Browse files
authored
WRO-8722: Update in-editor linting guide (#51)
* update index.md * update index.md 2 * define nodepath on Troubleshooting * remove dot * update index.md * remove empty line * fix enact-proxy-related guide * update .travis.yml * add a guidance for adding eslintConfig property * enact-proxy
1 parent ab28438 commit 6a05137

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

docs/index.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ If you are not using the `cli` tools, you can create (or modify) an `.eslintrc`
3636

3737
```json
3838
{
39-
"extends": "enact"
39+
"extends": "enact-proxy"
4040
}
4141
```
4242
>**NOTE**: For strict mode, use `"extends": "enact-proxy/strict"`.
@@ -52,6 +52,21 @@ You would need to install an ESLint plugin for your editor first.
5252
Ever since ESLint 6, global installs of ESLint configs are no longer supported.
5353
To work around this new limitation, while still supporting in-editor linting, we've created a new [eslint-config-enact-proxy](https://github.com/enactjs/eslint-config-enact-proxy) package.
5454
The [eslint-config-enact-proxy](https://github.com/enactjs/eslint-config-enact-proxy) acts like a small proxy config, redirecting ESLint to use a globally-installed Enact ESLint config.
55+
`eslint-config-enact-proxy` needs to be installed locally on a project to enable in-editor linting:
56+
57+
```sh
58+
npm install --save-dev eslint-config-enact-proxy
59+
```
60+
61+
Also, you need to modify `eslintConfig` property in `package.json`:
62+
63+
```json
64+
"eslintConfig": {
65+
"extends": "enact-proxy"
66+
},
67+
```
68+
>**NOTE**: For strict mode, use `"extends": "enact-proxy/strict"`.
69+
5570
In order for in-editor linting to work with our updated ESLint config, you'll need to upgrade to ESLint 7 or later. This can be installed globally by running:
5671

5772
```sh
@@ -61,7 +76,7 @@ npm install -g eslint
6176
Then, you will need to uninstall any previous globally-installed Enact linting package (everything but eslint itself):
6277

6378
```sh
64-
npm remove -g eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-babel @babel/eslint-parser eslint-plugin-jest eslint-plugin-enact eslint-config-enact
79+
npm uninstall -g eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-babel @babel/eslint-parser eslint-plugin-jest eslint-plugin-enact eslint-config-enact
6580
```
6681

6782
Each editor requires a slightly different setup. Jump to the section relevant to your editor.

0 commit comments

Comments
 (0)