Skip to content

Commit 776827a

Browse files
kecrilysnitin315mdjermanovic
authored
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>
1 parent 72dbfbc commit 776827a

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,28 @@ You can install and configure ESLint using this command:
2525
npm init @eslint/config
2626
```
2727

28+
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:
29+
30+
```shell
31+
# use `eslint-config-semistandard` shared config
32+
# npm 6.x
33+
npm init @eslint/config --config semistandard
34+
35+
# ⚠️ npm 7+, extra double-dash is needed:
36+
npm init @eslint/config -- --config semistandard
37+
38+
# or (`eslint-config` prefix is optional)
39+
npm init @eslint/config -- --config eslint-config-semistandard
40+
```
41+
42+
The `--config` flag also supports passing in arrays:
43+
44+
```shell
45+
npm init @eslint/config -- --config semistandard,standard
46+
# or
47+
npm init @eslint/config -- --config semistandard --config standard
48+
```
49+
2850
**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.
2951

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

0 commit comments

Comments
 (0)