Skip to content

Commit 9456ed1

Browse files
authored
docs: improve config example in README (#245)
1 parent 9b137ad commit 9456ed1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ npm install eslint-plugin-eslint-plugin --save-dev
3232

3333
## <a name='Usage'></a>Usage
3434

35-
Add `eslint-plugin` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:
35+
Here's an example ESLint configuration that:
3636

37-
```json
38-
{
39-
"plugins": [
40-
"eslint-plugin"
41-
]
42-
}
43-
```
44-
45-
Then configure the rules you want to use under the rules section.
37+
* Sets `sourceType` to `script` for CJS plugins (most users) (use `module` for ESM/TypeScript)
38+
* Enables the `recommended` configuration
39+
* Enables an optional/non-recommended rule
4640

4741
```json
4842
{
43+
"parserOptions": {
44+
"sourceType": "script"
45+
},
46+
"extends": [
47+
"plugin:eslint-plugin/recommended"
48+
],
4949
"rules": {
50-
"eslint-plugin/no-deprecated-report-api": "error"
50+
"eslint-plugin/require-meta-docs-description": "error"
5151
}
5252
}
5353
```

0 commit comments

Comments
 (0)