Skip to content

Commit

Permalink
Clarify how to install the plugin
Browse files Browse the repository at this point in the history
The markup was misleading, as it put several alternatives into one block of code while not making it clear where the alternatives begin and end, forcing the reader to think hard about it.
  • Loading branch information
jwbth authored Mar 28, 2024
1 parent 2de78c1 commit 457bac9
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
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...
```
1. 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
```

2. 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

0 comments on commit 457bac9

Please sign in to comment.