Skip to content

Commit e151050

Browse files
authored
docs: update get-started to the new @eslint/create-config (#18217)
* docs: update get-started to the new `@eslint/create-config` * Update README.md * Update getting-started.md
1 parent 610c148 commit e151050

2 files changed

Lines changed: 7 additions & 25 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,11 @@ After that, you can run ESLint on any file or directory like this:
5959

6060
## Configuration
6161

62-
After running `npm init @eslint/config`, you'll have an `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
63-
64-
```json
65-
{
66-
"rules": {
67-
"semi": ["error", "always"],
68-
"quotes": ["error", "double"]
69-
}
70-
}
62+
After running `npm init @eslint/config`, you'll have an `eslint.config.js` or `eslint.config.mjs` file in your directory. In it, you'll see some rules configured like this:
63+
64+
```js
65+
import pluginJs from "@eslint/js";
66+
export default [ pluginJs.configs.recommended, ];
7167
```
7268

7369
The names `"semi"` and `"quotes"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values:

‎docs/src/use/getting-started.md‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,11 @@ npm init @eslint/config
2727
If you want to use a specific shareable config that is hosted on npm, you can use the `--config` option and specify the package name:
2828

2929
```shell
30-
# use `eslint-config-semistandard` shared config
30+
# use `eslint-config-standard` shared config
3131

3232
# npm 7+
33-
npm init @eslint/config -- --config semistandard
33+
npm init @eslint/config -- --config eslint-config-standard
3434

35-
# or (`eslint-config` prefix is optional)
36-
npm init @eslint/config -- --config eslint-config-semistandard
37-
38-
# ⚠️ npm 6.x no extra double-dash:
39-
npm init @eslint/config --config semistandard
40-
41-
```
42-
43-
The `--config` flag also supports passing in arrays:
44-
45-
```shell
46-
npm init @eslint/config -- --config semistandard,standard
47-
# or
48-
npm init @eslint/config -- --config semistandard --config standard
4935
```
5036

5137
**Note:** `npm init @eslint/config` assumes you have a `package.json` file already. If you don't, make sure to run `npm init` or `yarn init` beforehand.

0 commit comments

Comments
 (0)