eslint-plugin-playwright 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -118,11 +118,15 @@ command line option.\
118
118
  [suggestions](https://eslint.org/docs/latest/developer-guide/working-with-rules#providing-suggestions).
119
119
 
120
120
  | ✔ | 🔧 | 💡 | Rule | Description |
121
- | :-: | :-: | :-: | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
121
+ | :-: | :-: | :-: | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | --- |
122
122
  | ✔ | | | [expect-expect](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/expect-expect.md) | Enforce assertion to be made in a test body |
123
+ | ✔ | | | [max-expects](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/max-expects.md) | Enforces a maximum number assertion calls in a test body | |
123
124
  | ✔ | | | [max-nested-describe](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/max-nested-describe.md) | Enforces a maximum depth to nested describe calls |
124
125
  | ✔ | 🔧 | | [missing-playwright-await](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/missing-playwright-await.md) | Enforce Playwright APIs to be awaited |
126
+ | | | | [no-commented-out-test](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-commented-out-test.md) | Disallow commented out tests |
127
+ | ✔ | | | [no-conditional-expect](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-conditional-expect.md) | Disallow calling `expect` conditionally |
125
128
  | ✔ | | | [no-conditional-in-test](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-conditional-in-test.md) | Disallow conditional logic in tests |
129
+ | | | | [no-duplicate-hooks](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-duplicate-hooks.md) | Disallow duplicate setup and teardown hooks |
126
130
  | ✔ | | 💡 | [no-element-handle](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-element-handle.md) | Disallow usage of element handles |
127
131
  | ✔ | | | [no-eval](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-eval.md) | Disallow usage of `page.$eval()` and `page.$$eval()` |
128
132
  | ✔ | | 💡 | [no-focused-test](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-focused-test.md) | Disallow usage of `.only` annotation |
@@ -137,9 +141,12 @@ command line option.\
137
141
  | ✔ | 🔧 | | [no-useless-await](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-useless-await.md) | Disallow unnecessary `await`s for Playwright methods |
138
142
  | | | | [no-restricted-matchers](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-restricted-matchers.md) | Disallow specific matchers & modifiers |
139
143
  | ✔ | | 💡 | [no-skipped-test](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-skipped-test.md) | Disallow usage of the `.skip` annotation |
144
+ | ✔ | | | [no-standalone-expect](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-standalone-expect.md) | Disallow using expect outside of `test` blocks |
140
145
  | ✔ | 🔧 | | [no-useless-not](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-useless-not.md) | Disallow usage of `not` matchers when a specific matcher exists |
141
146
  | ✔ | | 💡 | [no-wait-for-selector](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-wait-for-selector.md) | Disallow usage of `page.waitForSelector()` |
142
147
  | ✔ | | 💡 | [no-wait-for-timeout](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-wait-for-timeout.md) | Disallow usage of `page.waitForTimeout()` |
148
+ | | | | [prefer-hooks-in-order](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-hooks-in-order.md) | Prefer having hooks in a consistent order |
149
+ | | | | [prefer-hooks-on-top](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-hooks-on-top.md) | Suggest having hooks before any test cases |
143
150
  | | | 💡 | [prefer-strict-equal](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-strict-equal.md) | Suggest using `toStrictEqual()` |
144
151
  | | 🔧 | | [prefer-lowercase-title](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-lowercase-title.md) | Enforce lowercase test names |
145
152
  | | 🔧 | | [prefer-to-be](https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-to-be.md) | Suggest using `toBe()` |
package/dist/index.d.mts CHANGED
@@ -11,9 +11,13 @@ declare const _default: {
11
11
  configs: {};
12
12
  rules: {
13
13
  'expect-expect': eslint.Rule.RuleModule;
14
+ 'max-expects': eslint.Rule.RuleModule;
14
15
  'max-nested-describe': eslint.Rule.RuleModule;
15
16
  'missing-playwright-await': eslint.Rule.RuleModule;
17
+ 'no-commented-out-tests': eslint.Rule.RuleModule;
18
+ 'no-conditional-expect': eslint.Rule.RuleModule;
16
19
  'no-conditional-in-test': eslint.Rule.RuleModule;
20
+ 'no-duplicate-hooks': eslint.Rule.RuleModule;
17
21
  'no-element-handle': eslint.Rule.RuleModule;
18
22
  'no-eval': eslint.Rule.RuleModule;
19
23
  'no-focused-test': eslint.Rule.RuleModule;
@@ -26,11 +30,14 @@ declare const _default: {
26
30
  'no-raw-locators': eslint.Rule.RuleModule;
27
31
  'no-restricted-matchers': eslint.Rule.RuleModule;
28
32
  'no-skipped-test': eslint.Rule.RuleModule;
33
+ 'no-standalone-expect': eslint.Rule.RuleModule;
29
34
  'no-unsafe-references': eslint.Rule.RuleModule;
30
35
  'no-useless-await': eslint.Rule.RuleModule;
31
36
  'no-useless-not': eslint.Rule.RuleModule;
32
37
  'no-wait-for-selector': eslint.Rule.RuleModule;
33
38
  'no-wait-for-timeout': eslint.Rule.RuleModule;
39
+ 'prefer-hooks-in-order': eslint.Rule.RuleModule;
40
+ 'prefer-hooks-on-top': eslint.Rule.RuleModule;
34
41
  'prefer-lowercase-title': eslint.Rule.RuleModule;
35
42
  'prefer-strict-equal': eslint.Rule.RuleModule;
36
43
  'prefer-to-be': eslint.Rule.RuleModule;
@@ -62,9 +69,13 @@ declare const _default: {
62
69
  configs: {};
63
70
  rules: {
64
71
  'expect-expect': eslint.Rule.RuleModule;
72
+ 'max-expects': eslint.Rule.RuleModule;
65
73
  'max-nested-describe': eslint.Rule.RuleModule;
66
74
  'missing-playwright-await': eslint.Rule.RuleModule;
75
+ 'no-commented-out-tests': eslint.Rule.RuleModule;
76
+ 'no-conditional-expect': eslint.Rule.RuleModule;
67
77
  'no-conditional-in-test': eslint.Rule.RuleModule;
78
+ 'no-duplicate-hooks': eslint.Rule.RuleModule;
68
79
  'no-element-handle': eslint.Rule.RuleModule;
69
80
  'no-eval': eslint.Rule.RuleModule;
70
81
  'no-focused-test': eslint.Rule.RuleModule;
@@ -77,11 +88,14 @@ declare const _default: {
77
88
  'no-raw-locators': eslint.Rule.RuleModule;
78
89
  'no-restricted-matchers': eslint.Rule.RuleModule;
79
90
  'no-skipped-test': eslint.Rule.RuleModule;
91
+ 'no-standalone-expect': eslint.Rule.RuleModule;
80
92
  'no-unsafe-references': eslint.Rule.RuleModule;
81
93
  'no-useless-await': eslint.Rule.RuleModule;
82
94
  'no-useless-not': eslint.Rule.RuleModule;
83
95
  'no-wait-for-selector': eslint.Rule.RuleModule;
84
96
  'no-wait-for-timeout': eslint.Rule.RuleModule;
97
+ 'prefer-hooks-in-order': eslint.Rule.RuleModule;
98
+ 'prefer-hooks-on-top': eslint.Rule.RuleModule;
85
99
  'prefer-lowercase-title': eslint.Rule.RuleModule;
86
100
  'prefer-strict-equal': eslint.Rule.RuleModule;
87
101
  'prefer-to-be': eslint.Rule.RuleModule;
@@ -101,6 +115,7 @@ declare const _default: {
101
115
  'playwright/expect-expect': string;
102
116
  'playwright/max-nested-describe': string;
103
117
  'playwright/missing-playwright-await': string;
118
+ 'playwright/no-conditional-expect': string;
104
119
  'playwright/no-conditional-in-test': string;
105
120
  'playwright/no-element-handle': string;
106
121
  'playwright/no-eval': string;
@@ -110,6 +125,7 @@ declare const _default: {
110
125
  'playwright/no-networkidle': string;
111
126
  'playwright/no-page-pause': string;
112
127
  'playwright/no-skipped-test': string;
128
+ 'playwright/no-standalone-expect': string;
113
129
  'playwright/no-unsafe-references': string;
114
130
  'playwright/no-useless-await': string;
115
131
  'playwright/no-useless-not': string;
@@ -152,6 +168,7 @@ declare const _default: {
152
168
  'playwright/expect-expect': string;
153
169
  'playwright/max-nested-describe': string;
154
170
  'playwright/missing-playwright-await': string;
171
+ 'playwright/no-conditional-expect': string;
155
172
  'playwright/no-conditional-in-test': string;
156
173
  'playwright/no-element-handle': string;
157
174
  'playwright/no-eval': string;
@@ -161,6 +178,7 @@ declare const _default: {
161
178
  'playwright/no-networkidle': string;
162
179
  'playwright/no-page-pause': string;
163
180
  'playwright/no-skipped-test': string;
181
+ 'playwright/no-standalone-expect': string;
164
182
  'playwright/no-unsafe-references': string;
165
183
  'playwright/no-useless-await': string;
166
184
  'playwright/no-useless-not': string;
@@ -181,6 +199,7 @@ declare const _default: {
181
199
  'playwright/expect-expect': string;
182
200
  'playwright/max-nested-describe': string;
183
201
  'playwright/missing-playwright-await': string;
202
+ 'playwright/no-conditional-expect': string;
184
203
  'playwright/no-conditional-in-test': string;
185
204
  'playwright/no-element-handle': string;
186
205
  'playwright/no-eval': string;
@@ -190,6 +209,7 @@ declare const _default: {
190
209
  'playwright/no-networkidle': string;
191
210
  'playwright/no-page-pause': string;
192
211
  'playwright/no-skipped-test': string;
212
+ 'playwright/no-standalone-expect': string;
193
213
  'playwright/no-unsafe-references': string;
194
214
  'playwright/no-useless-await': string;
195
215
  'playwright/no-useless-not': string;
@@ -203,9 +223,13 @@ declare const _default: {
203
223
  };
204
224
  rules: {
205
225
  'expect-expect': eslint.Rule.RuleModule;
226
+ 'max-expects': eslint.Rule.RuleModule;
206
227
  'max-nested-describe': eslint.Rule.RuleModule;
207
228
  'missing-playwright-await': eslint.Rule.RuleModule;
229
+ 'no-commented-out-tests': eslint.Rule.RuleModule;
230
+ 'no-conditional-expect': eslint.Rule.RuleModule;
208
231
  'no-conditional-in-test': eslint.Rule.RuleModule;
232
+ 'no-duplicate-hooks': eslint.Rule.RuleModule;
209
233
  'no-element-handle': eslint.Rule.RuleModule;
210
234
  'no-eval': eslint.Rule.RuleModule;
211
235
  'no-focused-test': eslint.Rule.RuleModule;
@@ -218,11 +242,14 @@ declare const _default: {
218
242
  'no-raw-locators': eslint.Rule.RuleModule;
219
243
  'no-restricted-matchers': eslint.Rule.RuleModule;
220
244
  'no-skipped-test': eslint.Rule.RuleModule;
245
+ 'no-standalone-expect': eslint.Rule.RuleModule;
221
246
  'no-unsafe-references': eslint.Rule.RuleModule;
222
247
  'no-useless-await': eslint.Rule.RuleModule;
223
248
  'no-useless-not': eslint.Rule.RuleModule;
224
249
  'no-wait-for-selector': eslint.Rule.RuleModule;
225
250
  'no-wait-for-timeout': eslint.Rule.RuleModule;
251
+ 'prefer-hooks-in-order': eslint.Rule.RuleModule;
252
+ 'prefer-hooks-on-top': eslint.Rule.RuleModule;
226
253
  'prefer-lowercase-title': eslint.Rule.RuleModule;
227
254
  'prefer-strict-equal': eslint.Rule.RuleModule;
228
255
  'prefer-to-be': eslint.Rule.RuleModule;
package/dist/index.d.ts CHANGED
@@ -11,9 +11,13 @@ declare const _default: {
11
11
  configs: {};
12
12
  rules: {
13
13
  'expect-expect': eslint.Rule.RuleModule;
14
+ 'max-expects': eslint.Rule.RuleModule;
14
15
  'max-nested-describe': eslint.Rule.RuleModule;
15
16
  'missing-playwright-await': eslint.Rule.RuleModule;
17
+ 'no-commented-out-tests': eslint.Rule.RuleModule;
18
+ 'no-conditional-expect': eslint.Rule.RuleModule;
16
19
  'no-conditional-in-test': eslint.Rule.RuleModule;
20
+ 'no-duplicate-hooks': eslint.Rule.RuleModule;
17
21
  'no-element-handle': eslint.Rule.RuleModule;
18
22
  'no-eval': eslint.Rule.RuleModule;
19
23
  'no-focused-test': eslint.Rule.RuleModule;
@@ -26,11 +30,14 @@ declare const _default: {
26
30
  'no-raw-locators': eslint.Rule.RuleModule;
27
31
  'no-restricted-matchers': eslint.Rule.RuleModule;
28
32
  'no-skipped-test': eslint.Rule.RuleModule;
33
+ 'no-standalone-expect': eslint.Rule.RuleModule;
29
34
  'no-unsafe-references': eslint.Rule.RuleModule;
30
35
  'no-useless-await': eslint.Rule.RuleModule;
31
36
  'no-useless-not': eslint.Rule.RuleModule;
32
37
  'no-wait-for-selector': eslint.Rule.RuleModule;
33
38
  'no-wait-for-timeout': eslint.Rule.RuleModule;
39
+ 'prefer-hooks-in-order': eslint.Rule.RuleModule;
40
+ 'prefer-hooks-on-top': eslint.Rule.RuleModule;
34
41
  'prefer-lowercase-title': eslint.Rule.RuleModule;
35
42
  'prefer-strict-equal': eslint.Rule.RuleModule;
36
43
  'prefer-to-be': eslint.Rule.RuleModule;
@@ -62,9 +69,13 @@ declare const _default: {
62
69
  configs: {};
63
70
  rules: {
64
71
  'expect-expect': eslint.Rule.RuleModule;
72
+ 'max-expects': eslint.Rule.RuleModule;
65
73
  'max-nested-describe': eslint.Rule.RuleModule;
66
74
  'missing-playwright-await': eslint.Rule.RuleModule;
75
+ 'no-commented-out-tests': eslint.Rule.RuleModule;
76
+ 'no-conditional-expect': eslint.Rule.RuleModule;
67
77
  'no-conditional-in-test': eslint.Rule.RuleModule;
78
+ 'no-duplicate-hooks': eslint.Rule.RuleModule;
68
79
  'no-element-handle': eslint.Rule.RuleModule;
69
80
  'no-eval': eslint.Rule.RuleModule;
70
81
  'no-focused-test': eslint.Rule.RuleModule;
@@ -77,11 +88,14 @@ declare const _default: {
77
88
  'no-raw-locators': eslint.Rule.RuleModule;
78
89
  'no-restricted-matchers': eslint.Rule.RuleModule;
79
90
  'no-skipped-test': eslint.Rule.RuleModule;
91
+ 'no-standalone-expect': eslint.Rule.RuleModule;
80
92
  'no-unsafe-references': eslint.Rule.RuleModule;
81
93
  'no-useless-await': eslint.Rule.RuleModule;
82
94
  'no-useless-not': eslint.Rule.RuleModule;
83
95
  'no-wait-for-selector': eslint.Rule.RuleModule;
84
96
  'no-wait-for-timeout': eslint.Rule.RuleModule;
97
+ 'prefer-hooks-in-order': eslint.Rule.RuleModule;
98
+ 'prefer-hooks-on-top': eslint.Rule.RuleModule;
85
99
  'prefer-lowercase-title': eslint.Rule.RuleModule;
86
100
  'prefer-strict-equal': eslint.Rule.RuleModule;
87
101
  'prefer-to-be': eslint.Rule.RuleModule;
@@ -101,6 +115,7 @@ declare const _default: {
101
115
  'playwright/expect-expect': string;
102
116
  'playwright/max-nested-describe': string;
103
117
  'playwright/missing-playwright-await': string;
118
+ 'playwright/no-conditional-expect': string;
104
119
  'playwright/no-conditional-in-test': string;
105
120
  'playwright/no-element-handle': string;
106
121
  'playwright/no-eval': string;
@@ -110,6 +125,7 @@ declare const _default: {
110
125
  'playwright/no-networkidle': string;
111
126
  'playwright/no-page-pause': string;
112
127
  'playwright/no-skipped-test': string;
128
+ 'playwright/no-standalone-expect': string;
113
129
  'playwright/no-unsafe-references': string;
114
130
  'playwright/no-useless-await': string;
115
131
  'playwright/no-useless-not': string;
@@ -152,6 +168,7 @@ declare const _default: {
152
168
  'playwright/expect-expect': string;
153
169
  'playwright/max-nested-describe': string;
154
170
  'playwright/missing-playwright-await': string;
171
+ 'playwright/no-conditional-expect': string;
155
172
  'playwright/no-conditional-in-test': string;
156
173
  'playwright/no-element-handle': string;
157
174
  'playwright/no-eval': string;
@@ -161,6 +178,7 @@ declare const _default: {
161
178
  'playwright/no-networkidle': string;
162
179
  'playwright/no-page-pause': string;
163
180
  'playwright/no-skipped-test': string;
181
+ 'playwright/no-standalone-expect': string;
164
182
  'playwright/no-unsafe-references': string;
165
183
  'playwright/no-useless-await': string;
166
184
  'playwright/no-useless-not': string;
@@ -181,6 +199,7 @@ declare const _default: {
181
199
  'playwright/expect-expect': string;
182
200
  'playwright/max-nested-describe': string;
183
201
  'playwright/missing-playwright-await': string;
202
+ 'playwright/no-conditional-expect': string;
184
203
  'playwright/no-conditional-in-test': string;
185
204
  'playwright/no-element-handle': string;
186
205
  'playwright/no-eval': string;
@@ -190,6 +209,7 @@ declare const _default: {
190
209
  'playwright/no-networkidle': string;
191
210
  'playwright/no-page-pause': string;
192
211
  'playwright/no-skipped-test': string;
212
+ 'playwright/no-standalone-expect': string;
193
213
  'playwright/no-unsafe-references': string;
194
214
  'playwright/no-useless-await': string;
195
215
  'playwright/no-useless-not': string;
@@ -203,9 +223,13 @@ declare const _default: {
203
223
  };
204
224
  rules: {
205
225
  'expect-expect': eslint.Rule.RuleModule;
226
+ 'max-expects': eslint.Rule.RuleModule;
206
227
  'max-nested-describe': eslint.Rule.RuleModule;
207
228
  'missing-playwright-await': eslint.Rule.RuleModule;
229
+ 'no-commented-out-tests': eslint.Rule.RuleModule;
230
+ 'no-conditional-expect': eslint.Rule.RuleModule;
208
231
  'no-conditional-in-test': eslint.Rule.RuleModule;
232
+ 'no-duplicate-hooks': eslint.Rule.RuleModule;
209
233
  'no-element-handle': eslint.Rule.RuleModule;
210
234
  'no-eval': eslint.Rule.RuleModule;
211
235
  'no-focused-test': eslint.Rule.RuleModule;
@@ -218,11 +242,14 @@ declare const _default: {
218
242
  'no-raw-locators': eslint.Rule.RuleModule;
219
243
  'no-restricted-matchers': eslint.Rule.RuleModule;
220
244
  'no-skipped-test': eslint.Rule.RuleModule;
245
+ 'no-standalone-expect': eslint.Rule.RuleModule;
221
246
  'no-unsafe-references': eslint.Rule.RuleModule;
222
247
  'no-useless-await': eslint.Rule.RuleModule;
223
248
  'no-useless-not': eslint.Rule.RuleModule;
224
249
  'no-wait-for-selector': eslint.Rule.RuleModule;
225
250
  'no-wait-for-timeout': eslint.Rule.RuleModule;
251
+ 'prefer-hooks-in-order': eslint.Rule.RuleModule;
252
+ 'prefer-hooks-on-top': eslint.Rule.RuleModule;
226
253
  'prefer-lowercase-title': eslint.Rule.RuleModule;
227
254
  'prefer-strict-equal': eslint.Rule.RuleModule;
228
255
  'prefer-to-be': eslint.Rule.RuleModule;