Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: init config about specifying shared configs (#16483)
* docs: init config about specifying shared configs

* remove yarn command

* Update docs/src/user-guide/getting-started.md

Co-authored-by: Nitin Kumar <snitin315@gmail.com>

* Update docs/src/user-guide/getting-started.md

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

Co-authored-by: Nitin Kumar <snitin315@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
3 people committed Nov 9, 2022
1 parent 72dbfbc commit 776827a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/src/user-guide/getting-started.md
Expand Up @@ -25,6 +25,28 @@ You can install and configure ESLint using this command:
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
# npm 6.x
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` or `yarn init` beforehand.

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

0 comments on commit 776827a

Please sign in to comment.