Skip to content

Commit d60a4a4

Browse files
committed
Add documentation for recommended configuration
1 parent d779bf4 commit d60a4a4

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

β€ŽREADME.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,34 @@ Add `jest-dom` to the plugins section of your `.eslintrc` configuration file. Yo
2424

2525
```json
2626
{
27-
"plugins": [
28-
"jest-dom"
29-
]
27+
"plugins": ["jest-dom"]
3028
}
3129
```
3230

33-
3431
Then configure the rules you want to use under the rules section.
3532

3633
```json
3734
{
38-
"rules": {
39-
"jest-dom/prefer-checked": "error",
40-
"jest-dom/prefer-enabled-disabled": "error",
41-
"jest-dom/prefer-required": "error"
42-
}
35+
"rules": {
36+
"jest-dom/prefer-checked": "error",
37+
"jest-dom/prefer-enabled-disabled": "error",
38+
"jest-dom/prefer-required": "error"
39+
}
40+
}
41+
```
42+
43+
## Recommended Configuration
44+
45+
This plugin exports a recommended configuration that enforces good
46+
`jest-dom` practices _(you can find more info about enabled rules
47+
in [Supported Rules section](#supported-rules))_.
48+
49+
To enable this configuration use the `extends` property in your
50+
`.eslintrc` config file:
51+
52+
```json
53+
{
54+
"extends": ["plugin:jest-dom/recommended"]
4355
}
4456
```
4557

@@ -50,14 +62,11 @@ Then configure the rules you want to use under the rules section.
5062
πŸ›  indicates that a rule is fixable.
5163

5264
<!-- __BEGIN AUTOGENERATED TABLE__ -->
53-
Name | βœ”οΈ | πŸ›  | Description
54-
----- | ----- | ----- | -----
55-
[prefer-checked](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-checked.md) | βœ”οΈ | πŸ›  | prefer toBeChecked over checking attributes
56-
[prefer-enabled-disabled](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-enabled-disabled.md) | βœ”οΈ | πŸ›  | prefer toBeDisabled or toBeEnabled over checking attributes
57-
[prefer-required](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-required.md) | βœ”οΈ | πŸ›  | prefer toBeRequired over checking properties
58-
<!-- __END AUTOGENERATED TABLE__ -->
59-
60-
61-
6265

66+
| Name | βœ”οΈ | πŸ›  | Description |
67+
| -------------------------------------------------------------------------------------------------------------------------------------- | --- | --- | ----------------------------------------------------------- |
68+
| [prefer-checked](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-checked.md) | βœ”οΈ | πŸ›  | prefer toBeChecked over checking attributes |
69+
| [prefer-enabled-disabled](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-enabled-disabled.md) | βœ”οΈ | πŸ›  | prefer toBeDisabled or toBeEnabled over checking attributes |
70+
| [prefer-required](https://github.com/testing-library/eslint-plugin-jest-dom/blob/master/docs/rules/prefer-required.md) | βœ”οΈ | πŸ›  | prefer toBeRequired over checking properties |
6371

72+
<!-- __END AUTOGENERATED TABLE__ -->

0 commit comments

Comments
Β (0)