Skip to content

Commit

Permalink
docs: update get-started to the new @eslint/create-config (#18217)
Browse files Browse the repository at this point in the history
* docs: update get-started to the new `@eslint/create-config`

* Update README.md

* Update getting-started.md
  • Loading branch information
aladdin-add committed Apr 5, 2024
1 parent 610c148 commit e151050
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
14 changes: 5 additions & 9 deletions README.md
Expand Up @@ -59,15 +59,11 @@ After that, you can run ESLint on any file or directory like this:

## Configuration

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:

```json
{
"rules": {
"semi": ["error", "always"],
"quotes": ["error", "double"]
}
}
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:

```js
import pluginJs from "@eslint/js";
export default [ pluginJs.configs.recommended, ];
```

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:
Expand Down
18 changes: 2 additions & 16 deletions docs/src/use/getting-started.md
Expand Up @@ -27,25 +27,11 @@ npm init @eslint/config
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:

```shell
# use `eslint-config-semistandard` shared config
# use `eslint-config-standard` shared config

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

# or (`eslint-config` prefix is optional)
npm init @eslint/config -- --config eslint-config-semistandard

# ⚠️ npm 6.x no extra double-dash:
npm init @eslint/config --config semistandard

```

The `--config` flag also supports passing in arrays:

```shell
npm init @eslint/config -- --config semistandard,standard
# or
npm init @eslint/config -- --config semistandard --config standard
```

**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.
Expand Down

0 comments on commit e151050

Please sign in to comment.