Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: init config about specifying shared configs #16483

Merged
merged 4 commits into from Nov 9, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion docs/src/user-guide/getting-started.md
Expand Up @@ -25,7 +25,29 @@ You can install and configure ESLint using this command:
npm init @eslint/config
```

**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.
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
# npm 6.x, yarn or pnpm
kecrily marked this conversation as resolved.
Show resolved Hide resolved
npm init @eslint/config --config semistandard

# ⚠️ npm 7+, extra double-dash is needed:
npm init @eslint/config -- --config semistandard

# or (`eslint-config` prefix is optional)
npm init @eslint/config -- --config eslint-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` beforehand.
kecrily marked this conversation as resolved.
Show resolved Hide resolved

After that, you can run ESLint on any file or directory like this:

Expand Down