Skip to content

Docs: Add example of using rule/test presets in overrides to README #204

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

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,23 @@ Presets are enabled by adding a line to the `extends` list in your config file.
}
```

Or to apply linting only to the appropriate rule or test files:

```json
{
"overrides": [
{
"files": ["lib/rules/*.{js,ts}"],
"extends": ["plugin:eslint-plugin/rules-recommended"]
},
{
"files": ["tests/lib/rules/*.{js,ts}"],
"extends": ["plugin:eslint-plugin/tests-recommended"]
},
]
}
```

* `recommended` enables all recommended rules from this plugin.
* `rules-recommended` enables all recommended rules that are aimed at linting ESLint rule files.
* `tests-recommended` enables all recommended rules that are aimed at linting ESLint test files.
Expand Down