Skip to content

Commit 2e86892

Browse files
authored
docs: add example of using rule/test presets in overrides to README (#204)
1 parent b58b35a commit 2e86892

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ Presets are enabled by adding a line to the `extends` list in your config file.
8585
}
8686
```
8787

88+
Or to apply linting only to the appropriate rule or test files:
89+
90+
```json
91+
{
92+
"overrides": [
93+
{
94+
"files": ["lib/rules/*.{js,ts}"],
95+
"extends": ["plugin:eslint-plugin/rules-recommended"]
96+
},
97+
{
98+
"files": ["tests/lib/rules/*.{js,ts}"],
99+
"extends": ["plugin:eslint-plugin/tests-recommended"]
100+
},
101+
]
102+
}
103+
```
104+
88105
* `recommended` enables all recommended rules from this plugin.
89106
* `rules-recommended` enables all recommended rules that are aimed at linting ESLint rule files.
90107
* `tests-recommended` enables all recommended rules that are aimed at linting ESLint test files.

0 commit comments

Comments
 (0)