eslint-plugin-playwright 1.5.2 → 1.5.4

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/dist/index.d.mts CHANGED
@@ -60,11 +60,11 @@ declare const _default: {
60
60
  };
61
61
  };
62
62
  rules: {
63
- 'jest/no-standalone-expect': (string | {
64
- additionalTestBlockFunctions: string[];
65
- })[];
66
- 'playwright/missing-playwright-await': string;
67
- 'playwright/no-page-pause': string;
63
+ readonly 'jest/no-standalone-expect': readonly ["error", {
64
+ readonly additionalTestBlockFunctions: readonly ["test.jestPlaywrightDebug", "it.jestPlaywrightDebug", "test.jestPlaywrightSkip", "it.jestPlaywrightSkip", "test.jestPlaywrightConfig", "it.jestPlaywrightConfig"];
65
+ }];
66
+ readonly 'playwright/missing-playwright-await': "error";
67
+ readonly 'playwright/no-page-pause': "warn";
68
68
  };
69
69
  };
70
70
  'flat/recommended': {
@@ -125,31 +125,31 @@ declare const _default: {
125
125
  };
126
126
  };
127
127
  rules: {
128
- 'no-empty-pattern': string;
129
- 'playwright/expect-expect': string;
130
- 'playwright/max-nested-describe': string;
131
- 'playwright/missing-playwright-await': string;
132
- 'playwright/no-conditional-expect': string;
133
- 'playwright/no-conditional-in-test': string;
134
- 'playwright/no-element-handle': string;
135
- 'playwright/no-eval': string;
136
- 'playwright/no-focused-test': string;
137
- 'playwright/no-force-option': string;
138
- 'playwright/no-nested-step': string;
139
- 'playwright/no-networkidle': string;
140
- 'playwright/no-page-pause': string;
141
- 'playwright/no-skipped-test': string;
142
- 'playwright/no-standalone-expect': string;
143
- 'playwright/no-unsafe-references': string;
144
- 'playwright/no-useless-await': string;
145
- 'playwright/no-useless-not': string;
146
- 'playwright/no-wait-for-selector': string;
147
- 'playwright/no-wait-for-timeout': string;
148
- 'playwright/prefer-web-first-assertions': string;
149
- 'playwright/valid-describe-callback': string;
150
- 'playwright/valid-expect': string;
151
- 'playwright/valid-expect-in-promise': string;
152
- 'playwright/valid-title': string;
128
+ readonly 'no-empty-pattern': "off";
129
+ readonly 'playwright/expect-expect': "warn";
130
+ readonly 'playwright/max-nested-describe': "warn";
131
+ readonly 'playwright/missing-playwright-await': "error";
132
+ readonly 'playwright/no-conditional-expect': "warn";
133
+ readonly 'playwright/no-conditional-in-test': "warn";
134
+ readonly 'playwright/no-element-handle': "warn";
135
+ readonly 'playwright/no-eval': "warn";
136
+ readonly 'playwright/no-focused-test': "error";
137
+ readonly 'playwright/no-force-option': "warn";
138
+ readonly 'playwright/no-nested-step': "warn";
139
+ readonly 'playwright/no-networkidle': "error";
140
+ readonly 'playwright/no-page-pause': "warn";
141
+ readonly 'playwright/no-skipped-test': "warn";
142
+ readonly 'playwright/no-standalone-expect': "error";
143
+ readonly 'playwright/no-unsafe-references': "error";
144
+ readonly 'playwright/no-useless-await': "warn";
145
+ readonly 'playwright/no-useless-not': "warn";
146
+ readonly 'playwright/no-wait-for-selector': "warn";
147
+ readonly 'playwright/no-wait-for-timeout': "warn";
148
+ readonly 'playwright/prefer-web-first-assertions': "error";
149
+ readonly 'playwright/valid-describe-callback': "error";
150
+ readonly 'playwright/valid-expect': "error";
151
+ readonly 'playwright/valid-expect-in-promise': "error";
152
+ readonly 'playwright/valid-title': "error";
153
153
  };
154
154
  };
155
155
  'jest-playwright': {
@@ -167,11 +167,11 @@ declare const _default: {
167
167
  };
168
168
  plugins: string[];
169
169
  rules: {
170
- 'jest/no-standalone-expect': (string | {
171
- additionalTestBlockFunctions: string[];
172
- })[];
173
- 'playwright/missing-playwright-await': string;
174
- 'playwright/no-page-pause': string;
170
+ readonly 'jest/no-standalone-expect': readonly ["error", {
171
+ readonly additionalTestBlockFunctions: readonly ["test.jestPlaywrightDebug", "it.jestPlaywrightDebug", "test.jestPlaywrightSkip", "it.jestPlaywrightSkip", "test.jestPlaywrightConfig", "it.jestPlaywrightConfig"];
172
+ }];
173
+ readonly 'playwright/missing-playwright-await': "error";
174
+ readonly 'playwright/no-page-pause': "warn";
175
175
  };
176
176
  };
177
177
  'playwright-test': {
@@ -180,31 +180,31 @@ declare const _default: {
180
180
  };
181
181
  plugins: string[];
182
182
  rules: {
183
- 'no-empty-pattern': string;
184
- 'playwright/expect-expect': string;
185
- 'playwright/max-nested-describe': string;
186
- 'playwright/missing-playwright-await': string;
187
- 'playwright/no-conditional-expect': string;
188
- 'playwright/no-conditional-in-test': string;
189
- 'playwright/no-element-handle': string;
190
- 'playwright/no-eval': string;
191
- 'playwright/no-focused-test': string;
192
- 'playwright/no-force-option': string;
193
- 'playwright/no-nested-step': string;
194
- 'playwright/no-networkidle': string;
195
- 'playwright/no-page-pause': string;
196
- 'playwright/no-skipped-test': string;
197
- 'playwright/no-standalone-expect': string;
198
- 'playwright/no-unsafe-references': string;
199
- 'playwright/no-useless-await': string;
200
- 'playwright/no-useless-not': string;
201
- 'playwright/no-wait-for-selector': string;
202
- 'playwright/no-wait-for-timeout': string;
203
- 'playwright/prefer-web-first-assertions': string;
204
- 'playwright/valid-describe-callback': string;
205
- 'playwright/valid-expect': string;
206
- 'playwright/valid-expect-in-promise': string;
207
- 'playwright/valid-title': string;
183
+ readonly 'no-empty-pattern': "off";
184
+ readonly 'playwright/expect-expect': "warn";
185
+ readonly 'playwright/max-nested-describe': "warn";
186
+ readonly 'playwright/missing-playwright-await': "error";
187
+ readonly 'playwright/no-conditional-expect': "warn";
188
+ readonly 'playwright/no-conditional-in-test': "warn";
189
+ readonly 'playwright/no-element-handle': "warn";
190
+ readonly 'playwright/no-eval': "warn";
191
+ readonly 'playwright/no-focused-test': "error";
192
+ readonly 'playwright/no-force-option': "warn";
193
+ readonly 'playwright/no-nested-step': "warn";
194
+ readonly 'playwright/no-networkidle': "error";
195
+ readonly 'playwright/no-page-pause': "warn";
196
+ readonly 'playwright/no-skipped-test': "warn";
197
+ readonly 'playwright/no-standalone-expect': "error";
198
+ readonly 'playwright/no-unsafe-references': "error";
199
+ readonly 'playwright/no-useless-await': "warn";
200
+ readonly 'playwright/no-useless-not': "warn";
201
+ readonly 'playwright/no-wait-for-selector': "warn";
202
+ readonly 'playwright/no-wait-for-timeout': "warn";
203
+ readonly 'playwright/prefer-web-first-assertions': "error";
204
+ readonly 'playwright/valid-describe-callback': "error";
205
+ readonly 'playwright/valid-expect': "error";
206
+ readonly 'playwright/valid-expect-in-promise': "error";
207
+ readonly 'playwright/valid-title': "error";
208
208
  };
209
209
  };
210
210
  recommended: {
@@ -213,31 +213,31 @@ declare const _default: {
213
213
  };
214
214
  plugins: string[];
215
215
  rules: {
216
- 'no-empty-pattern': string;
217
- 'playwright/expect-expect': string;
218
- 'playwright/max-nested-describe': string;
219
- 'playwright/missing-playwright-await': string;
220
- 'playwright/no-conditional-expect': string;
221
- 'playwright/no-conditional-in-test': string;
222
- 'playwright/no-element-handle': string;
223
- 'playwright/no-eval': string;
224
- 'playwright/no-focused-test': string;
225
- 'playwright/no-force-option': string;
226
- 'playwright/no-nested-step': string;
227
- 'playwright/no-networkidle': string;
228
- 'playwright/no-page-pause': string;
229
- 'playwright/no-skipped-test': string;
230
- 'playwright/no-standalone-expect': string;
231
- 'playwright/no-unsafe-references': string;
232
- 'playwright/no-useless-await': string;
233
- 'playwright/no-useless-not': string;
234
- 'playwright/no-wait-for-selector': string;
235
- 'playwright/no-wait-for-timeout': string;
236
- 'playwright/prefer-web-first-assertions': string;
237
- 'playwright/valid-describe-callback': string;
238
- 'playwright/valid-expect': string;
239
- 'playwright/valid-expect-in-promise': string;
240
- 'playwright/valid-title': string;
216
+ readonly 'no-empty-pattern': "off";
217
+ readonly 'playwright/expect-expect': "warn";
218
+ readonly 'playwright/max-nested-describe': "warn";
219
+ readonly 'playwright/missing-playwright-await': "error";
220
+ readonly 'playwright/no-conditional-expect': "warn";
221
+ readonly 'playwright/no-conditional-in-test': "warn";
222
+ readonly 'playwright/no-element-handle': "warn";
223
+ readonly 'playwright/no-eval': "warn";
224
+ readonly 'playwright/no-focused-test': "error";
225
+ readonly 'playwright/no-force-option': "warn";
226
+ readonly 'playwright/no-nested-step': "warn";
227
+ readonly 'playwright/no-networkidle': "error";
228
+ readonly 'playwright/no-page-pause': "warn";
229
+ readonly 'playwright/no-skipped-test': "warn";
230
+ readonly 'playwright/no-standalone-expect': "error";
231
+ readonly 'playwright/no-unsafe-references': "error";
232
+ readonly 'playwright/no-useless-await': "warn";
233
+ readonly 'playwright/no-useless-not': "warn";
234
+ readonly 'playwright/no-wait-for-selector': "warn";
235
+ readonly 'playwright/no-wait-for-timeout': "warn";
236
+ readonly 'playwright/prefer-web-first-assertions': "error";
237
+ readonly 'playwright/valid-describe-callback': "error";
238
+ readonly 'playwright/valid-expect': "error";
239
+ readonly 'playwright/valid-expect-in-promise': "error";
240
+ readonly 'playwright/valid-title': "error";
241
241
  };
242
242
  };
243
243
  };
package/dist/index.d.ts CHANGED
@@ -60,11 +60,11 @@ declare const _default: {
60
60
  };
61
61
  };
62
62
  rules: {
63
- 'jest/no-standalone-expect': (string | {
64
- additionalTestBlockFunctions: string[];
65
- })[];
66
- 'playwright/missing-playwright-await': string;
67
- 'playwright/no-page-pause': string;
63
+ readonly 'jest/no-standalone-expect': readonly ["error", {
64
+ readonly additionalTestBlockFunctions: readonly ["test.jestPlaywrightDebug", "it.jestPlaywrightDebug", "test.jestPlaywrightSkip", "it.jestPlaywrightSkip", "test.jestPlaywrightConfig", "it.jestPlaywrightConfig"];
65
+ }];
66
+ readonly 'playwright/missing-playwright-await': "error";
67
+ readonly 'playwright/no-page-pause': "warn";
68
68
  };
69
69
  };
70
70
  'flat/recommended': {
@@ -125,31 +125,31 @@ declare const _default: {
125
125
  };
126
126
  };
127
127
  rules: {
128
- 'no-empty-pattern': string;
129
- 'playwright/expect-expect': string;
130
- 'playwright/max-nested-describe': string;
131
- 'playwright/missing-playwright-await': string;
132
- 'playwright/no-conditional-expect': string;
133
- 'playwright/no-conditional-in-test': string;
134
- 'playwright/no-element-handle': string;
135
- 'playwright/no-eval': string;
136
- 'playwright/no-focused-test': string;
137
- 'playwright/no-force-option': string;
138
- 'playwright/no-nested-step': string;
139
- 'playwright/no-networkidle': string;
140
- 'playwright/no-page-pause': string;
141
- 'playwright/no-skipped-test': string;
142
- 'playwright/no-standalone-expect': string;
143
- 'playwright/no-unsafe-references': string;
144
- 'playwright/no-useless-await': string;
145
- 'playwright/no-useless-not': string;
146
- 'playwright/no-wait-for-selector': string;
147
- 'playwright/no-wait-for-timeout': string;
148
- 'playwright/prefer-web-first-assertions': string;
149
- 'playwright/valid-describe-callback': string;
150
- 'playwright/valid-expect': string;
151
- 'playwright/valid-expect-in-promise': string;
152
- 'playwright/valid-title': string;
128
+ readonly 'no-empty-pattern': "off";
129
+ readonly 'playwright/expect-expect': "warn";
130
+ readonly 'playwright/max-nested-describe': "warn";
131
+ readonly 'playwright/missing-playwright-await': "error";
132
+ readonly 'playwright/no-conditional-expect': "warn";
133
+ readonly 'playwright/no-conditional-in-test': "warn";
134
+ readonly 'playwright/no-element-handle': "warn";
135
+ readonly 'playwright/no-eval': "warn";
136
+ readonly 'playwright/no-focused-test': "error";
137
+ readonly 'playwright/no-force-option': "warn";
138
+ readonly 'playwright/no-nested-step': "warn";
139
+ readonly 'playwright/no-networkidle': "error";
140
+ readonly 'playwright/no-page-pause': "warn";
141
+ readonly 'playwright/no-skipped-test': "warn";
142
+ readonly 'playwright/no-standalone-expect': "error";
143
+ readonly 'playwright/no-unsafe-references': "error";
144
+ readonly 'playwright/no-useless-await': "warn";
145
+ readonly 'playwright/no-useless-not': "warn";
146
+ readonly 'playwright/no-wait-for-selector': "warn";
147
+ readonly 'playwright/no-wait-for-timeout': "warn";
148
+ readonly 'playwright/prefer-web-first-assertions': "error";
149
+ readonly 'playwright/valid-describe-callback': "error";
150
+ readonly 'playwright/valid-expect': "error";
151
+ readonly 'playwright/valid-expect-in-promise': "error";
152
+ readonly 'playwright/valid-title': "error";
153
153
  };
154
154
  };
155
155
  'jest-playwright': {
@@ -167,11 +167,11 @@ declare const _default: {
167
167
  };
168
168
  plugins: string[];
169
169
  rules: {
170
- 'jest/no-standalone-expect': (string | {
171
- additionalTestBlockFunctions: string[];
172
- })[];
173
- 'playwright/missing-playwright-await': string;
174
- 'playwright/no-page-pause': string;
170
+ readonly 'jest/no-standalone-expect': readonly ["error", {
171
+ readonly additionalTestBlockFunctions: readonly ["test.jestPlaywrightDebug", "it.jestPlaywrightDebug", "test.jestPlaywrightSkip", "it.jestPlaywrightSkip", "test.jestPlaywrightConfig", "it.jestPlaywrightConfig"];
172
+ }];
173
+ readonly 'playwright/missing-playwright-await': "error";
174
+ readonly 'playwright/no-page-pause': "warn";
175
175
  };
176
176
  };
177
177
  'playwright-test': {
@@ -180,31 +180,31 @@ declare const _default: {
180
180
  };
181
181
  plugins: string[];
182
182
  rules: {
183
- 'no-empty-pattern': string;
184
- 'playwright/expect-expect': string;
185
- 'playwright/max-nested-describe': string;
186
- 'playwright/missing-playwright-await': string;
187
- 'playwright/no-conditional-expect': string;
188
- 'playwright/no-conditional-in-test': string;
189
- 'playwright/no-element-handle': string;
190
- 'playwright/no-eval': string;
191
- 'playwright/no-focused-test': string;
192
- 'playwright/no-force-option': string;
193
- 'playwright/no-nested-step': string;
194
- 'playwright/no-networkidle': string;
195
- 'playwright/no-page-pause': string;
196
- 'playwright/no-skipped-test': string;
197
- 'playwright/no-standalone-expect': string;
198
- 'playwright/no-unsafe-references': string;
199
- 'playwright/no-useless-await': string;
200
- 'playwright/no-useless-not': string;
201
- 'playwright/no-wait-for-selector': string;
202
- 'playwright/no-wait-for-timeout': string;
203
- 'playwright/prefer-web-first-assertions': string;
204
- 'playwright/valid-describe-callback': string;
205
- 'playwright/valid-expect': string;
206
- 'playwright/valid-expect-in-promise': string;
207
- 'playwright/valid-title': string;
183
+ readonly 'no-empty-pattern': "off";
184
+ readonly 'playwright/expect-expect': "warn";
185
+ readonly 'playwright/max-nested-describe': "warn";
186
+ readonly 'playwright/missing-playwright-await': "error";
187
+ readonly 'playwright/no-conditional-expect': "warn";
188
+ readonly 'playwright/no-conditional-in-test': "warn";
189
+ readonly 'playwright/no-element-handle': "warn";
190
+ readonly 'playwright/no-eval': "warn";
191
+ readonly 'playwright/no-focused-test': "error";
192
+ readonly 'playwright/no-force-option': "warn";
193
+ readonly 'playwright/no-nested-step': "warn";
194
+ readonly 'playwright/no-networkidle': "error";
195
+ readonly 'playwright/no-page-pause': "warn";
196
+ readonly 'playwright/no-skipped-test': "warn";
197
+ readonly 'playwright/no-standalone-expect': "error";
198
+ readonly 'playwright/no-unsafe-references': "error";
199
+ readonly 'playwright/no-useless-await': "warn";
200
+ readonly 'playwright/no-useless-not': "warn";
201
+ readonly 'playwright/no-wait-for-selector': "warn";
202
+ readonly 'playwright/no-wait-for-timeout': "warn";
203
+ readonly 'playwright/prefer-web-first-assertions': "error";
204
+ readonly 'playwright/valid-describe-callback': "error";
205
+ readonly 'playwright/valid-expect': "error";
206
+ readonly 'playwright/valid-expect-in-promise': "error";
207
+ readonly 'playwright/valid-title': "error";
208
208
  };
209
209
  };
210
210
  recommended: {
@@ -213,31 +213,31 @@ declare const _default: {
213
213
  };
214
214
  plugins: string[];
215
215
  rules: {
216
- 'no-empty-pattern': string;
217
- 'playwright/expect-expect': string;
218
- 'playwright/max-nested-describe': string;
219
- 'playwright/missing-playwright-await': string;
220
- 'playwright/no-conditional-expect': string;
221
- 'playwright/no-conditional-in-test': string;
222
- 'playwright/no-element-handle': string;
223
- 'playwright/no-eval': string;
224
- 'playwright/no-focused-test': string;
225
- 'playwright/no-force-option': string;
226
- 'playwright/no-nested-step': string;
227
- 'playwright/no-networkidle': string;
228
- 'playwright/no-page-pause': string;
229
- 'playwright/no-skipped-test': string;
230
- 'playwright/no-standalone-expect': string;
231
- 'playwright/no-unsafe-references': string;
232
- 'playwright/no-useless-await': string;
233
- 'playwright/no-useless-not': string;
234
- 'playwright/no-wait-for-selector': string;
235
- 'playwright/no-wait-for-timeout': string;
236
- 'playwright/prefer-web-first-assertions': string;
237
- 'playwright/valid-describe-callback': string;
238
- 'playwright/valid-expect': string;
239
- 'playwright/valid-expect-in-promise': string;
240
- 'playwright/valid-title': string;
216
+ readonly 'no-empty-pattern': "off";
217
+ readonly 'playwright/expect-expect': "warn";
218
+ readonly 'playwright/max-nested-describe': "warn";
219
+ readonly 'playwright/missing-playwright-await': "error";
220
+ readonly 'playwright/no-conditional-expect': "warn";
221
+ readonly 'playwright/no-conditional-in-test': "warn";
222
+ readonly 'playwright/no-element-handle': "warn";
223
+ readonly 'playwright/no-eval': "warn";
224
+ readonly 'playwright/no-focused-test': "error";
225
+ readonly 'playwright/no-force-option': "warn";
226
+ readonly 'playwright/no-nested-step': "warn";
227
+ readonly 'playwright/no-networkidle': "error";
228
+ readonly 'playwright/no-page-pause': "warn";
229
+ readonly 'playwright/no-skipped-test': "warn";
230
+ readonly 'playwright/no-standalone-expect': "error";
231
+ readonly 'playwright/no-unsafe-references': "error";
232
+ readonly 'playwright/no-useless-await': "warn";
233
+ readonly 'playwright/no-useless-not': "warn";
234
+ readonly 'playwright/no-wait-for-selector': "warn";
235
+ readonly 'playwright/no-wait-for-timeout': "warn";
236
+ readonly 'playwright/prefer-web-first-assertions': "error";
237
+ readonly 'playwright/valid-describe-callback': "error";
238
+ readonly 'playwright/valid-expect': "error";
239
+ readonly 'playwright/valid-expect-in-promise': "error";
240
+ readonly 'playwright/valid-title': "error";
241
241
  };
242
242
  };
243
243
  };
package/dist/index.js CHANGED
@@ -1957,8 +1957,8 @@ var prefer_comparison_matcher_default = {
1957
1957
  const call = parseFnCall(context, node);
1958
1958
  if (call?.type !== "expect" || call.matcherArgs.length === 0)
1959
1959
  return;
1960
- const expect = findParent(call.head.node, "CallExpression");
1961
- if (!expect)
1960
+ const expect = getParent(call.head.node);
1961
+ if (expect?.type !== "CallExpression")
1962
1962
  return;
1963
1963
  const [comparison] = expect.arguments;
1964
1964
  const expectCallEnd = expect.range[1];
@@ -2028,8 +2028,8 @@ var prefer_equality_matcher_default = {
2028
2028
  const call = parseFnCall(context, node);
2029
2029
  if (call?.type !== "expect" || call.matcherArgs.length === 0)
2030
2030
  return;
2031
- const expect = findParent(call.head.node, "CallExpression");
2032
- if (!expect)
2031
+ const expect = getParent(call.head.node);
2032
+ if (expect?.type !== "CallExpression")
2033
2033
  return;
2034
2034
  const [comparison] = expect.arguments;
2035
2035
  const expectCallEnd = expect.range[1];
@@ -2422,8 +2422,8 @@ var prefer_to_contain_default = {
2422
2422
  const call = parseFnCall(context, node);
2423
2423
  if (call?.type !== "expect" || call.matcherArgs.length === 0)
2424
2424
  return;
2425
- const expect = findParent(call.head.node, "CallExpression");
2426
- if (!expect)
2425
+ const expect = getParent(call.head.node);
2426
+ if (expect?.type !== "CallExpression")
2427
2427
  return;
2428
2428
  const [includesCall] = expect.arguments;
2429
2429
  const { matcher } = call;
@@ -2630,7 +2630,7 @@ var supportedMatchers = /* @__PURE__ */ new Set([
2630
2630
  "toBeFalsy"
2631
2631
  ]);
2632
2632
  function dereference(context, node) {
2633
- if (node.type !== "Identifier") {
2633
+ if (node?.type !== "Identifier") {
2634
2634
  return node;
2635
2635
  }
2636
2636
  const scope = context.sourceCode.getScope(node);
@@ -3099,8 +3099,8 @@ var valid_expect_default = {
3099
3099
  } else if (call?.type !== "expect") {
3100
3100
  return;
3101
3101
  }
3102
- const expect = findParent(call.head.node, "CallExpression");
3103
- if (!expect)
3102
+ const expect = getParent(call.head.node);
3103
+ if (expect?.type !== "CallExpression")
3104
3104
  return;
3105
3105
  if (expect.arguments.length < minArgs) {
3106
3106
  const expectLength = getStringValue(call.head.node).length;
package/dist/index.mjs CHANGED
@@ -2173,8 +2173,8 @@ var init_prefer_comparison_matcher = __esm({
2173
2173
  const call = parseFnCall(context, node);
2174
2174
  if (call?.type !== "expect" || call.matcherArgs.length === 0)
2175
2175
  return;
2176
- const expect = findParent(call.head.node, "CallExpression");
2177
- if (!expect)
2176
+ const expect = getParent(call.head.node);
2177
+ if (expect?.type !== "CallExpression")
2178
2178
  return;
2179
2179
  const [comparison] = expect.arguments;
2180
2180
  const expectCallEnd = expect.range[1];
@@ -2252,8 +2252,8 @@ var init_prefer_equality_matcher = __esm({
2252
2252
  const call = parseFnCall(context, node);
2253
2253
  if (call?.type !== "expect" || call.matcherArgs.length === 0)
2254
2254
  return;
2255
- const expect = findParent(call.head.node, "CallExpression");
2256
- if (!expect)
2255
+ const expect = getParent(call.head.node);
2256
+ if (expect?.type !== "CallExpression")
2257
2257
  return;
2258
2258
  const [comparison] = expect.arguments;
2259
2259
  const expectCallEnd = expect.range[1];
@@ -2693,8 +2693,8 @@ var init_prefer_to_contain = __esm({
2693
2693
  const call = parseFnCall(context, node);
2694
2694
  if (call?.type !== "expect" || call.matcherArgs.length === 0)
2695
2695
  return;
2696
- const expect = findParent(call.head.node, "CallExpression");
2697
- if (!expect)
2696
+ const expect = getParent(call.head.node);
2697
+ if (expect?.type !== "CallExpression")
2698
2698
  return;
2699
2699
  const [includesCall] = expect.arguments;
2700
2700
  const { matcher } = call;
@@ -2880,7 +2880,7 @@ var init_prefer_to_have_length = __esm({
2880
2880
 
2881
2881
  // src/rules/prefer-web-first-assertions.ts
2882
2882
  function dereference(context, node) {
2883
- if (node.type !== "Identifier") {
2883
+ if (node?.type !== "Identifier") {
2884
2884
  return node;
2885
2885
  }
2886
2886
  const scope = context.sourceCode.getScope(node);
@@ -3445,8 +3445,8 @@ var init_valid_expect = __esm({
3445
3445
  } else if (call?.type !== "expect") {
3446
3446
  return;
3447
3447
  }
3448
- const expect = findParent(call.head.node, "CallExpression");
3449
- if (!expect)
3448
+ const expect = getParent(call.head.node);
3449
+ if (expect?.type !== "CallExpression")
3450
3450
  return;
3451
3451
  if (expect.arguments.length < minArgs) {
3452
3452
  const expectLength = getStringValue(call.head.node).length;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-playwright",
3
3
  "description": "ESLint plugin for Playwright testing.",
4
- "version": "1.5.2",
4
+ "version": "1.5.4",
5
5
  "repository": "https://github.com/playwright-community/eslint-plugin-playwright",
6
6
  "author": "Mark Skelton <mark@mskelton.dev>",
7
7
  "packageManager": "pnpm@8.12.0",