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

Make it clear how to install the plugin #2993

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
53 changes: 30 additions & 23 deletions README.md
Expand Up @@ -106,30 +106,37 @@ The maintainers of `eslint-plugin-import` and thousands of other packages are wo
npm install eslint-plugin-import --save-dev
```

All rules are off by default. However, you may configure them manually
in your `.eslintrc.(yml|json|js)`, or extend one of the canned configs:
All rules are off by default. You may extend one of the canned configs, or configure them manually in your `.eslintrc.(yml|json|js)`.

```yaml
---
extends:
- eslint:recommended
- plugin:import/recommended
# alternatively, 'recommended' is the combination of these two rule sets:
- plugin:import/errors
- plugin:import/warnings

# or configure manually:
plugins:
- import

rules:
import/no-unresolved: [2, {commonjs: true, amd: true}]
import/named: 2
import/namespace: 2
import/default: 2
import/export: 2
# etc...
```
- Extending a canned config:

```yaml
extends:
- eslint:recommended
- plugin:import/recommended
```

`plugin:import/recommended` is the combination of these two rule sets, which you can also use instead:

```yaml
- plugin:import/errors
- plugin:import/warnings
```

- Configuring manually:

```yaml
plugins:
- import

rules:
import/no-unresolved: [2, {commonjs: true, amd: true}]
import/named: 2
import/namespace: 2
import/default: 2
import/export: 2
# etc...
```

## TypeScript

Expand Down