Skip to content

Commit c3d198b

Browse files
AmarMuric04Amar Muric
andauthored
docs: Update ESLint installation and configuration instructions (#2062)
Co-authored-by: Amar Muric <[email protected]>
1 parent de86497 commit c3d198b

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

README.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,64 @@
55

66
Integrates [ESLint](http://eslint.org/) into VS Code. If you are new to ESLint check the [documentation](http://eslint.org/).
77

8-
The extension uses the ESLint library installed in the opened workspace folder. If the folder doesn't provide one the extension looks for a global install version. If you haven't installed ESLint either locally or globally do so by running `npm install eslint` in the workspace folder for a local install or `npm install -g eslint` for a global install.
98

10-
On new folders you might also need to create an `.eslintrc` configuration file. You can do this by either using the VS Code command `Create ESLint configuration` or by running the `eslint` command in a terminal with [`npx eslint --init`](http://eslint.org/docs/user-guide/command-line-interface).
9+
Integrates [ESLint](http://eslint.org/) into VS Code. If you are new to ESLint check the [documentation](http://eslint.org/).
10+
11+
The extension uses the ESLint library installed in the opened workspace folder.
12+
If the folder doesn't provide one, the extension looks for a global install version.
13+
If you haven't installed ESLint either locally or globally, do so by running:
14+
15+
**Local install (recommended):**
16+
17+
```bash
18+
# npm
19+
npm install --save-dev eslint
20+
21+
# yarn
22+
yarn add --dev eslint
23+
24+
# pnpm
25+
pnpm add --save-dev eslint
26+
27+
# bun
28+
bun add --dev eslint
29+
```
30+
31+
**Global install:**
32+
33+
```bash
34+
# npm
35+
npm install -g eslint
36+
37+
# yarn
38+
yarn global add eslint
39+
40+
# pnpm
41+
pnpm add -g eslint
42+
43+
# bun
44+
bun add -g eslint
45+
```
46+
47+
On new projects you might need to create an ESLint configuration file.
48+
For ESLint v9 and later (or v8.57+ with flat config), this should be one of:
49+
50+
- eslint.config.js (most common)
51+
- eslint.config.mjs
52+
- eslint.config.cjs
53+
- eslint.config.ts
54+
- eslint.config.mts
55+
56+
You can generate a starter config by running:
57+
58+
`npx eslint --init`
59+
60+
Read more about [ESLint CLI](https://eslint.org/docs/latest/use/command-line-interface).
61+
62+
For projects using older ESLint versions (< 8.57), use a legacy `.eslintrc` file (`.eslintrc.json`, `.eslintrc.js`, etc.).
63+
64+
If you're using the legacy version, consider reading [how to migrate to flat config](https://eslint.org/docs/latest/use/configure/migration-guide).
65+
1166

1267
# Index
1368
* [Release Notes](#release-notes)

0 commit comments

Comments
 (0)