@@ -24,22 +24,34 @@ Add `jest-dom` to the plugins section of your `.eslintrc` configuration file. Yo
24
24
25
25
``` json
26
26
{
27
- "plugins" : [
28
- " jest-dom"
29
- ]
27
+ "plugins" : [" jest-dom" ]
30
28
}
31
29
```
32
30
33
-
34
31
Then configure the rules you want to use under the rules section.
35
32
36
33
``` json
37
34
{
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" ]
43
55
}
44
56
```
45
57
@@ -50,14 +62,11 @@ Then configure the rules you want to use under the rules section.
50
62
🛠 indicates that a rule is fixable.
51
63
52
64
<!-- __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
-
62
65
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 |
63
71
72
+ <!-- __END AUTOGENERATED TABLE__ -->
0 commit comments