Skip to content

Commit

Permalink
docs: update setup instructions (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Jun 26, 2024
1 parent 60c1a5c commit a906d24
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,32 @@ npm i -D eslint-plugin-depend

## Usage

Add to your `.eslintrc.json`:

```json
{
"extends": [
"plugin:depend/recommended"
]
}
```

Or if you're using (flat) config files, add to your `eslint.config.js`:
If you're using the new flat config files, add to your `eslint.config.js`:

```ts
import {configs} from 'eslint-plugin-depend';
import * as depend from 'eslint-plugin-depend';

export default [
configs['flat/recommended'],
depend.configs['flat/recommended'],

// or if you want to specify `files`, or other options
{
...configs['flat/recommended'],
...depend.configs['flat/recommended'],
files: ['test/**/*.js']
}
];
```

For older legacy projects, add to your `.eslintrc.json`:

```json
{
"extends": [
"plugin:depend/recommended"
]
}
```

### With `package.json`

Some rules (e.g. `ban-dependencies`) can be used against your `package.json`.
Expand Down

0 comments on commit a906d24

Please sign in to comment.