@@ -40,8 +40,9 @@ Then configure the rules you want to use under the rules section.
4040``` json
4141{
4242 "rules" : {
43- "testing-library/await-async-query" : " warn" ,
44- "testing-library/no-await-sync-query" : " error"
43+ "testing-library/await-async-query" : " error" ,
44+ "testing-library/no-await-sync-query" : " error" ,
45+ "testing-library/no-debug" : " warn"
4546 }
4647}
4748```
@@ -50,22 +51,77 @@ Then configure the rules you want to use under the rules section.
5051
5152### Recommended
5253
53- This plugin exports a recommended configuration that enforces good Testing Library practices.
54+ This plugin exports a recommended configuration that enforces good
55+ Testing Library practices _ (you can find more info about enabled rules
56+ in [ Supported Rules section] ( #supported-rules ) within Recommended
57+ column)_ .
5458
55- To enable this configuration use the ` extends ` property in your ` .eslintrc ` config file:
59+ To enable this configuration use the ` extends ` property in your
60+ ` .eslintrc ` config file:
5661
5762``` json
5863{
5964 "extends" : [" plugin:testing-library/recommended" ]
6065}
6166```
6267
68+ ### Frameworks
69+
70+ Starting from the premise that
71+ [ DOM Testing Library] ( https://testing-library.com/docs/dom-testing-library/intro )
72+ is the base for the rest of Testing Library frameworks wrappers, this
73+ plugin also exports different configuration for those frameworks that
74+ enforces good practices for specific rules that only apply to them _ (you
75+ can find more info about enabled rules in
76+ [ Supported Rules section] ( #supported-rules ) within Frameworks column)_ .
77+
78+ ** Note that frameworks configurations enable their specific rules +
79+ recommended rules.**
80+
81+ Available frameworks configurations are:
82+
83+ #### Angular
84+
85+ To enable this configuration use the ` extends ` property in your
86+ ` .eslintrc ` config file:
87+
88+ ``` json
89+ {
90+ "extends" : [" plugin:testing-library/angular" ]
91+ }
92+ ```
93+
94+ #### React
95+
96+ To enable this configuration use the ` extends ` property in your
97+ ` .eslintrc ` config file:
98+
99+ ``` json
100+ {
101+ "extends" : [" plugin:testing-library/react" ]
102+ }
103+ ```
104+
105+ #### Vue
106+
107+ To enable this configuration use the ` extends ` property in your
108+ ` .eslintrc ` config file:
109+
110+ ``` json
111+ {
112+ "extends" : [" plugin:testing-library/vue" ]
113+ }
114+ ```
115+
63116## Supported Rules
64117
65- | Rule | Description | Recommended |
66- | -------------------------------------------------------- | --------------------------------------------- | ---------------- |
67- | [ await-async-query] ( docs/rules/await-async-query.md ) | Enforce async queries to have proper ` await ` | ![ recommended] [ ] |
68- | [ no-await-sync-query] ( docs/rules/no-await-sync-query.md ) | Disallow unnecessary ` await ` for sync queries | ![ recommended] [ ] |
69- | [ no-debug] ( docs/rules/no-debug.md ) | Disallow the use of ` debug ` | |
118+ | Rule | Description | Recommended | Frameworks |
119+ | -------------------------------------------------------- | --------------------------------------------- | ---------------- | -------------------------------- |
120+ | [ await-async-query] ( docs/rules/await-async-query.md ) | Enforce async queries to have proper ` await ` | ![ recommended] [ ] | |
121+ | [ no-await-sync-query] ( docs/rules/no-await-sync-query.md ) | Disallow unnecessary ` await ` for sync queries | ![ recommended] [ ] | |
122+ | [ no-debug] ( docs/rules/no-debug.md ) | Disallow the use of ` debug ` | | ![ angular ] [ ] ![ react ] [ ] ![ vue ] [ ] |
70123
71124[ recommended ] : https://img.shields.io/badge/recommended-lightgrey?style=flat-square
125+ [ angular ] : https://img.shields.io/badge/-Angular-black?style=flat-square&logo=angular&logoColor=white&labelColor=DD0031&color=black
126+ [ react ] : https://img.shields.io/badge/-React-black?style=flat-square&logo=react&logoColor=white&labelColor=61DAFB&color=black
127+ [ vue ] : https://img.shields.io/badge/-Vue-black?style=flat-square&logo=vue.js&logoColor=white&labelColor=4FC08D&color=black
0 commit comments