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 +8 -1
- package/dist/index.d.mts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +429 -5
- package/dist/index.mjs +485 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54,9 +54,12 @@ function isStringNode(node) {
|
|
|
54
54
|
function isPropertyAccessor(node, name) {
|
|
55
55
|
return getStringValue(node.property) === name;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function getTestNames(context) {
|
|
58
58
|
const aliases = context.settings.playwright?.globalAliases?.test ?? [];
|
|
59
|
-
|
|
59
|
+
return ["test", ...aliases];
|
|
60
|
+
}
|
|
61
|
+
function isTestIdentifier(context, node) {
|
|
62
|
+
const testNames = getTestNames(context);
|
|
60
63
|
const regex = new RegExp(`^(${testNames.join("|")})$`);
|
|
61
64
|
return isIdentifier(node, regex) || node.type === "MemberExpression" && isIdentifier(node.object, regex);
|
|
62
65
|
}
|
|
@@ -86,9 +89,7 @@ function findParent(node, type) {
|
|
|
86
89
|
return node.parent.type === type ? node.parent : findParent(node.parent, type);
|
|
87
90
|
}
|
|
88
91
|
function isTestCall(context, node, modifiers) {
|
|
89
|
-
return isTestIdentifier(context, node.callee) && !isDescribeCall(node) && (node.callee.type !== "MemberExpression" || !modifiers || modifiers?.includes(getStringValue(node.callee.property))) && node.arguments.length === 2 && [
|
|
90
|
-
node.arguments[1].type
|
|
91
|
-
);
|
|
92
|
+
return isTestIdentifier(context, node.callee) && !isDescribeCall(node) && (node.callee.type !== "MemberExpression" || !modifiers || modifiers?.includes(getStringValue(node.callee.property))) && node.arguments.length === 2 && isFunction(node.arguments[1]);
|
|
92
93
|
}
|
|
93
94
|
var testHooks = /* @__PURE__ */ new Set(["afterAll", "afterEach", "beforeAll", "beforeEach"]);
|
|
94
95
|
function isTestHook(context, node) {
|
|
@@ -192,6 +193,69 @@ var expect_expect_default = {
|
|
|
192
193
|
}
|
|
193
194
|
};
|
|
194
195
|
|
|
196
|
+
// src/rules/max-expects.ts
|
|
197
|
+
var max_expects_default = {
|
|
198
|
+
create(context) {
|
|
199
|
+
const options = {
|
|
200
|
+
max: 5,
|
|
201
|
+
...context.options?.[0] ?? {}
|
|
202
|
+
};
|
|
203
|
+
let count = 0;
|
|
204
|
+
const maybeResetCount = (node) => {
|
|
205
|
+
const parent = getParent(node);
|
|
206
|
+
const isTestFn = parent?.type !== "CallExpression" || isTestCall(context, parent);
|
|
207
|
+
if (isTestFn) {
|
|
208
|
+
count = 0;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
ArrowFunctionExpression: maybeResetCount,
|
|
213
|
+
"ArrowFunctionExpression:exit": maybeResetCount,
|
|
214
|
+
CallExpression(node) {
|
|
215
|
+
if (!getExpectType(context, node))
|
|
216
|
+
return;
|
|
217
|
+
count += 1;
|
|
218
|
+
if (count > options.max) {
|
|
219
|
+
context.report({
|
|
220
|
+
data: {
|
|
221
|
+
count: count.toString(),
|
|
222
|
+
max: options.max.toString()
|
|
223
|
+
},
|
|
224
|
+
messageId: "exceededMaxAssertion",
|
|
225
|
+
node
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
FunctionExpression: maybeResetCount,
|
|
230
|
+
"FunctionExpression:exit": maybeResetCount
|
|
231
|
+
};
|
|
232
|
+
},
|
|
233
|
+
meta: {
|
|
234
|
+
docs: {
|
|
235
|
+
category: "Best Practices",
|
|
236
|
+
description: "Enforces a maximum number assertion calls in a test body",
|
|
237
|
+
recommended: false,
|
|
238
|
+
url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/max-expects.md"
|
|
239
|
+
},
|
|
240
|
+
messages: {
|
|
241
|
+
exceededMaxAssertion: "Too many assertion calls ({{ count }}) - maximum allowed is {{ max }}"
|
|
242
|
+
},
|
|
243
|
+
schema: [
|
|
244
|
+
{
|
|
245
|
+
additionalProperties: false,
|
|
246
|
+
properties: {
|
|
247
|
+
max: {
|
|
248
|
+
minimum: 1,
|
|
249
|
+
type: "integer"
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
type: "object"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
type: "suggestion"
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
|
|
195
259
|
// src/rules/max-nested-describe.ts
|
|
196
260
|
var max_nested_describe_default = {
|
|
197
261
|
create(context) {
|
|
@@ -399,6 +463,132 @@ var missing_playwright_await_default = {
|
|
|
399
463
|
}
|
|
400
464
|
};
|
|
401
465
|
|
|
466
|
+
// src/rules/no-commented-out-tests.ts
|
|
467
|
+
function hasTests(context, node) {
|
|
468
|
+
const testNames = getTestNames(context);
|
|
469
|
+
const names = testNames.join("|");
|
|
470
|
+
const regex = new RegExp(
|
|
471
|
+
`^\\s*(${names}|describe)(\\.\\w+|\\[['"]\\w+['"]\\])?\\s*\\(`,
|
|
472
|
+
"mu"
|
|
473
|
+
);
|
|
474
|
+
return regex.test(node.value);
|
|
475
|
+
}
|
|
476
|
+
var no_commented_out_tests_default = {
|
|
477
|
+
create(context) {
|
|
478
|
+
function checkNode(node) {
|
|
479
|
+
if (!hasTests(context, node))
|
|
480
|
+
return;
|
|
481
|
+
context.report({
|
|
482
|
+
messageId: "commentedTests",
|
|
483
|
+
node
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
return {
|
|
487
|
+
Program() {
|
|
488
|
+
context.sourceCode.getAllComments().forEach(checkNode);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
},
|
|
492
|
+
meta: {
|
|
493
|
+
docs: {
|
|
494
|
+
category: "Best Practices",
|
|
495
|
+
description: "Disallow commented out tests",
|
|
496
|
+
recommended: true,
|
|
497
|
+
url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-commented-out-tests.md"
|
|
498
|
+
},
|
|
499
|
+
messages: {
|
|
500
|
+
commentedTests: "Some tests seem to be commented"
|
|
501
|
+
},
|
|
502
|
+
type: "problem"
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
// src/rules/no-conditional-expect.ts
|
|
507
|
+
var isCatchCall = (node) => node.callee.type === "MemberExpression" && isPropertyAccessor(node.callee, "catch");
|
|
508
|
+
var getTestCallExpressionsFromDeclaredVariables = (context, declaredVariables) => {
|
|
509
|
+
return declaredVariables.reduce(
|
|
510
|
+
(acc, { references }) => [
|
|
511
|
+
...acc,
|
|
512
|
+
...references.map(({ identifier }) => getParent(identifier)).filter(
|
|
513
|
+
(node) => node?.type === "CallExpression" && isTestCall(context, node)
|
|
514
|
+
)
|
|
515
|
+
],
|
|
516
|
+
[]
|
|
517
|
+
);
|
|
518
|
+
};
|
|
519
|
+
var no_conditional_expect_default = {
|
|
520
|
+
create(context) {
|
|
521
|
+
let conditionalDepth = 0;
|
|
522
|
+
let inTestCase = false;
|
|
523
|
+
let inPromiseCatch = false;
|
|
524
|
+
const increaseConditionalDepth = () => inTestCase && conditionalDepth++;
|
|
525
|
+
const decreaseConditionalDepth = () => inTestCase && conditionalDepth--;
|
|
526
|
+
return {
|
|
527
|
+
CallExpression(node) {
|
|
528
|
+
if (isTestCall(context, node)) {
|
|
529
|
+
inTestCase = true;
|
|
530
|
+
}
|
|
531
|
+
if (isCatchCall(node)) {
|
|
532
|
+
inPromiseCatch = true;
|
|
533
|
+
}
|
|
534
|
+
const expectType = getExpectType(context, node);
|
|
535
|
+
if (inTestCase && expectType && conditionalDepth > 0) {
|
|
536
|
+
context.report({
|
|
537
|
+
messageId: "conditionalExpect",
|
|
538
|
+
node
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
if (inPromiseCatch && expectType) {
|
|
542
|
+
context.report({
|
|
543
|
+
messageId: "conditionalExpect",
|
|
544
|
+
node
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
},
|
|
548
|
+
"CallExpression:exit"(node) {
|
|
549
|
+
if (isTestCall(context, node)) {
|
|
550
|
+
inTestCase = false;
|
|
551
|
+
}
|
|
552
|
+
if (isCatchCall(node)) {
|
|
553
|
+
inPromiseCatch = false;
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
CatchClause: increaseConditionalDepth,
|
|
557
|
+
"CatchClause:exit": decreaseConditionalDepth,
|
|
558
|
+
ConditionalExpression: increaseConditionalDepth,
|
|
559
|
+
"ConditionalExpression:exit": decreaseConditionalDepth,
|
|
560
|
+
FunctionDeclaration(node) {
|
|
561
|
+
const declaredVariables = context.sourceCode.getDeclaredVariables(node);
|
|
562
|
+
const testCallExpressions = getTestCallExpressionsFromDeclaredVariables(
|
|
563
|
+
context,
|
|
564
|
+
declaredVariables
|
|
565
|
+
);
|
|
566
|
+
if (testCallExpressions.length > 0) {
|
|
567
|
+
inTestCase = true;
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
IfStatement: increaseConditionalDepth,
|
|
571
|
+
"IfStatement:exit": decreaseConditionalDepth,
|
|
572
|
+
LogicalExpression: increaseConditionalDepth,
|
|
573
|
+
"LogicalExpression:exit": decreaseConditionalDepth,
|
|
574
|
+
SwitchStatement: increaseConditionalDepth,
|
|
575
|
+
"SwitchStatement:exit": decreaseConditionalDepth
|
|
576
|
+
};
|
|
577
|
+
},
|
|
578
|
+
meta: {
|
|
579
|
+
docs: {
|
|
580
|
+
category: "Best Practices",
|
|
581
|
+
description: "Disallow calling `expect` conditionally",
|
|
582
|
+
recommended: true,
|
|
583
|
+
url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-conditional-expect.md"
|
|
584
|
+
},
|
|
585
|
+
messages: {
|
|
586
|
+
conditionalExpect: "Avoid calling `expect` conditionally`"
|
|
587
|
+
},
|
|
588
|
+
type: "problem"
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
|
|
402
592
|
// src/rules/no-conditional-in-test.ts
|
|
403
593
|
var no_conditional_in_test_default = {
|
|
404
594
|
create(context) {
|
|
@@ -430,6 +620,51 @@ var no_conditional_in_test_default = {
|
|
|
430
620
|
}
|
|
431
621
|
};
|
|
432
622
|
|
|
623
|
+
// src/rules/no-duplicate-hooks.ts
|
|
624
|
+
var no_duplicate_hooks_default = {
|
|
625
|
+
create(context) {
|
|
626
|
+
const hookContexts = [{}];
|
|
627
|
+
return {
|
|
628
|
+
CallExpression(node) {
|
|
629
|
+
if (isDescribeCall(node)) {
|
|
630
|
+
hookContexts.push({});
|
|
631
|
+
}
|
|
632
|
+
if (!isTestHook(context, node)) {
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
const currentLayer = hookContexts[hookContexts.length - 1];
|
|
636
|
+
const name = node.callee.type === "MemberExpression" ? getStringValue(node.callee.property) : "";
|
|
637
|
+
currentLayer[name] || (currentLayer[name] = 0);
|
|
638
|
+
currentLayer[name] += 1;
|
|
639
|
+
if (currentLayer[name] > 1) {
|
|
640
|
+
context.report({
|
|
641
|
+
data: { hook: name },
|
|
642
|
+
messageId: "noDuplicateHook",
|
|
643
|
+
node
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
"CallExpression:exit"(node) {
|
|
648
|
+
if (isDescribeCall(node)) {
|
|
649
|
+
hookContexts.pop();
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
},
|
|
654
|
+
meta: {
|
|
655
|
+
docs: {
|
|
656
|
+
category: "Best Practices",
|
|
657
|
+
description: "Disallow duplicate setup and teardown hooks",
|
|
658
|
+
recommended: false,
|
|
659
|
+
url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/no-duplicate-hooks.md"
|
|
660
|
+
},
|
|
661
|
+
messages: {
|
|
662
|
+
noDuplicateHook: "Duplicate {{ hook }} in describe block"
|
|
663
|
+
},
|
|
664
|
+
type: "suggestion"
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
|
|
433
668
|
// src/rules/no-element-handle.ts
|
|
434
669
|
function getPropertyRange(node) {
|
|
435
670
|
return node.type === "Identifier" ? node.range : [node.range[0] + 1, node.range[1] - 1];
|
|
@@ -997,6 +1232,95 @@ var no_skipped_test_default = {
|
|
|
997
1232
|
}
|
|
998
1233
|
};
|
|
999
1234
|
|
|
1235
|
+
// src/rules/no-standalone-expect.ts
|
|
1236
|
+
var getBlockType = (statement) => {
|
|
1237
|
+
const func = getParent(statement);
|
|
1238
|
+
if (!func) {
|
|
1239
|
+
throw new Error(
|
|
1240
|
+
`Unexpected BlockStatement. No parent defined. - please file a github issue at https://github.com/jest-community/eslint-plugin-jest`
|
|
1241
|
+
);
|
|
1242
|
+
}
|
|
1243
|
+
if (func.type === "FunctionDeclaration") {
|
|
1244
|
+
return "function";
|
|
1245
|
+
}
|
|
1246
|
+
if (isFunction(func) && func.parent) {
|
|
1247
|
+
const expr = func.parent;
|
|
1248
|
+
if (expr.type === "VariableDeclarator") {
|
|
1249
|
+
return "function";
|
|
1250
|
+
}
|
|
1251
|
+
if (expr.type === "CallExpression" && isDescribeCall(expr)) {
|
|
1252
|
+
return "describe";
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
return null;
|
|
1256
|
+
};
|
|
1257
|
+
var no_standalone_expect_default = {
|
|
1258
|
+
create(context) {
|
|
1259
|
+
const callStack = [];
|
|
1260
|
+
return {
|
|
1261
|
+
ArrowFunctionExpression(node) {
|
|
1262
|
+
if (node.parent?.type !== "CallExpression") {
|
|
1263
|
+
callStack.push("arrow");
|
|
1264
|
+
}
|
|
1265
|
+
},
|
|
1266
|
+
"ArrowFunctionExpression:exit"() {
|
|
1267
|
+
if (callStack[callStack.length - 1] === "arrow") {
|
|
1268
|
+
callStack.pop();
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
BlockStatement(statement) {
|
|
1272
|
+
const blockType = getBlockType(statement);
|
|
1273
|
+
if (blockType) {
|
|
1274
|
+
callStack.push(blockType);
|
|
1275
|
+
}
|
|
1276
|
+
},
|
|
1277
|
+
"BlockStatement:exit"(statement) {
|
|
1278
|
+
if (callStack[callStack.length - 1] === getBlockType(statement)) {
|
|
1279
|
+
callStack.pop();
|
|
1280
|
+
}
|
|
1281
|
+
},
|
|
1282
|
+
CallExpression(node) {
|
|
1283
|
+
if (getExpectType(context, node)) {
|
|
1284
|
+
const parent = callStack.at(-1);
|
|
1285
|
+
if (!parent || parent === "describe") {
|
|
1286
|
+
const root = findParent(node, "CallExpression");
|
|
1287
|
+
context.report({
|
|
1288
|
+
messageId: "unexpectedExpect",
|
|
1289
|
+
node: root ?? node
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
return;
|
|
1293
|
+
}
|
|
1294
|
+
if (isTestCall(context, node)) {
|
|
1295
|
+
callStack.push("test");
|
|
1296
|
+
}
|
|
1297
|
+
if (node.callee.type === "TaggedTemplateExpression") {
|
|
1298
|
+
callStack.push("template");
|
|
1299
|
+
}
|
|
1300
|
+
},
|
|
1301
|
+
"CallExpression:exit"(node) {
|
|
1302
|
+
const top = callStack[callStack.length - 1];
|
|
1303
|
+
if (top === "test" && isTestCall(context, node) && node.callee.type !== "MemberExpression" || top === "template" && node.callee.type === "TaggedTemplateExpression") {
|
|
1304
|
+
callStack.pop();
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
},
|
|
1309
|
+
meta: {
|
|
1310
|
+
docs: {
|
|
1311
|
+
category: "Best Practices",
|
|
1312
|
+
description: "Disallow using `expect` outside of `test` blocks",
|
|
1313
|
+
recommended: false,
|
|
1314
|
+
url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-to-contain.md"
|
|
1315
|
+
},
|
|
1316
|
+
fixable: "code",
|
|
1317
|
+
messages: {
|
|
1318
|
+
unexpectedExpect: "Expect must be inside of a test block"
|
|
1319
|
+
},
|
|
1320
|
+
type: "suggestion"
|
|
1321
|
+
}
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1000
1324
|
// src/utils/misc.ts
|
|
1001
1325
|
var getAmountData = (amount) => ({
|
|
1002
1326
|
amount: amount.toString(),
|
|
@@ -1319,6 +1643,97 @@ var no_wait_for_timeout_default = {
|
|
|
1319
1643
|
}
|
|
1320
1644
|
};
|
|
1321
1645
|
|
|
1646
|
+
// src/rules/prefer-hooks-in-order.ts
|
|
1647
|
+
var HooksOrder = ["beforeAll", "beforeEach", "afterEach", "afterAll"];
|
|
1648
|
+
var prefer_hooks_in_order_default = {
|
|
1649
|
+
create(context) {
|
|
1650
|
+
let previousHookIndex = -1;
|
|
1651
|
+
let inHook = false;
|
|
1652
|
+
return {
|
|
1653
|
+
CallExpression(node) {
|
|
1654
|
+
if (inHook)
|
|
1655
|
+
return;
|
|
1656
|
+
if (!isTestHook(context, node)) {
|
|
1657
|
+
previousHookIndex = -1;
|
|
1658
|
+
return;
|
|
1659
|
+
}
|
|
1660
|
+
inHook = true;
|
|
1661
|
+
const currentHook = node.callee.type === "MemberExpression" ? getStringValue(node.callee.property) : "";
|
|
1662
|
+
const currentHookIndex = HooksOrder.indexOf(currentHook);
|
|
1663
|
+
if (currentHookIndex < previousHookIndex) {
|
|
1664
|
+
return context.report({
|
|
1665
|
+
data: {
|
|
1666
|
+
currentHook,
|
|
1667
|
+
previousHook: HooksOrder[previousHookIndex]
|
|
1668
|
+
},
|
|
1669
|
+
messageId: "reorderHooks",
|
|
1670
|
+
node
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1673
|
+
previousHookIndex = currentHookIndex;
|
|
1674
|
+
},
|
|
1675
|
+
"CallExpression:exit"(node) {
|
|
1676
|
+
if (isTestHook(context, node)) {
|
|
1677
|
+
inHook = false;
|
|
1678
|
+
return;
|
|
1679
|
+
}
|
|
1680
|
+
if (inHook) {
|
|
1681
|
+
return;
|
|
1682
|
+
}
|
|
1683
|
+
previousHookIndex = -1;
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
},
|
|
1687
|
+
meta: {
|
|
1688
|
+
docs: {
|
|
1689
|
+
category: "Best Practices",
|
|
1690
|
+
description: "Prefer having hooks in a consistent order",
|
|
1691
|
+
recommended: false,
|
|
1692
|
+
url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-hooks-in-order.md"
|
|
1693
|
+
},
|
|
1694
|
+
messages: {
|
|
1695
|
+
reorderHooks: "`{{ currentHook }}` hooks should be before any `{{ previousHook }}` hooks"
|
|
1696
|
+
},
|
|
1697
|
+
type: "suggestion"
|
|
1698
|
+
}
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
// src/rules/prefer-hooks-on-top.ts
|
|
1702
|
+
var prefer_hooks_on_top_default = {
|
|
1703
|
+
create(context) {
|
|
1704
|
+
const stack = [false];
|
|
1705
|
+
return {
|
|
1706
|
+
CallExpression(node) {
|
|
1707
|
+
if (isTestCall(context, node)) {
|
|
1708
|
+
stack[stack.length - 1] = true;
|
|
1709
|
+
}
|
|
1710
|
+
if (stack.at(-1) && isTestHook(context, node)) {
|
|
1711
|
+
context.report({
|
|
1712
|
+
messageId: "noHookOnTop",
|
|
1713
|
+
node
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
stack.push(false);
|
|
1717
|
+
},
|
|
1718
|
+
"CallExpression:exit"() {
|
|
1719
|
+
stack.pop();
|
|
1720
|
+
}
|
|
1721
|
+
};
|
|
1722
|
+
},
|
|
1723
|
+
meta: {
|
|
1724
|
+
docs: {
|
|
1725
|
+
category: "Best Practices",
|
|
1726
|
+
description: "Suggest having hooks before any test cases",
|
|
1727
|
+
recommended: false,
|
|
1728
|
+
url: "https://github.com/playwright-community/eslint-plugin-playwright/tree/main/docs/rules/prefer-hooks-on-top.md"
|
|
1729
|
+
},
|
|
1730
|
+
messages: {
|
|
1731
|
+
noHookOnTop: "Hooks should come before test cases"
|
|
1732
|
+
},
|
|
1733
|
+
type: "suggestion"
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
|
|
1322
1737
|
// src/rules/prefer-lowercase-title.ts
|
|
1323
1738
|
var prefer_lowercase_title_default = {
|
|
1324
1739
|
create(context) {
|
|
@@ -2273,9 +2688,13 @@ var index = {
|
|
|
2273
2688
|
configs: {},
|
|
2274
2689
|
rules: {
|
|
2275
2690
|
"expect-expect": expect_expect_default,
|
|
2691
|
+
"max-expects": max_expects_default,
|
|
2276
2692
|
"max-nested-describe": max_nested_describe_default,
|
|
2277
2693
|
"missing-playwright-await": missing_playwright_await_default,
|
|
2694
|
+
"no-commented-out-tests": no_commented_out_tests_default,
|
|
2695
|
+
"no-conditional-expect": no_conditional_expect_default,
|
|
2278
2696
|
"no-conditional-in-test": no_conditional_in_test_default,
|
|
2697
|
+
"no-duplicate-hooks": no_duplicate_hooks_default,
|
|
2279
2698
|
"no-element-handle": no_element_handle_default,
|
|
2280
2699
|
"no-eval": no_eval_default,
|
|
2281
2700
|
"no-focused-test": no_focused_test_default,
|
|
@@ -2288,11 +2707,14 @@ var index = {
|
|
|
2288
2707
|
"no-raw-locators": no_raw_locators_default,
|
|
2289
2708
|
"no-restricted-matchers": no_restricted_matchers_default,
|
|
2290
2709
|
"no-skipped-test": no_skipped_test_default,
|
|
2710
|
+
"no-standalone-expect": no_standalone_expect_default,
|
|
2291
2711
|
"no-unsafe-references": no_unsafe_references_default,
|
|
2292
2712
|
"no-useless-await": no_useless_await_default,
|
|
2293
2713
|
"no-useless-not": no_useless_not_default,
|
|
2294
2714
|
"no-wait-for-selector": no_wait_for_selector_default,
|
|
2295
2715
|
"no-wait-for-timeout": no_wait_for_timeout_default,
|
|
2716
|
+
"prefer-hooks-in-order": prefer_hooks_in_order_default,
|
|
2717
|
+
"prefer-hooks-on-top": prefer_hooks_on_top_default,
|
|
2296
2718
|
"prefer-lowercase-title": prefer_lowercase_title_default,
|
|
2297
2719
|
"prefer-strict-equal": prefer_strict_equal_default,
|
|
2298
2720
|
"prefer-to-be": prefer_to_be_default,
|
|
@@ -2312,6 +2734,7 @@ var sharedConfig = {
|
|
|
2312
2734
|
"playwright/expect-expect": "warn",
|
|
2313
2735
|
"playwright/max-nested-describe": "warn",
|
|
2314
2736
|
"playwright/missing-playwright-await": "error",
|
|
2737
|
+
"playwright/no-conditional-expect": "warn",
|
|
2315
2738
|
"playwright/no-conditional-in-test": "warn",
|
|
2316
2739
|
"playwright/no-element-handle": "warn",
|
|
2317
2740
|
"playwright/no-eval": "warn",
|
|
@@ -2321,6 +2744,7 @@ var sharedConfig = {
|
|
|
2321
2744
|
"playwright/no-networkidle": "error",
|
|
2322
2745
|
"playwright/no-page-pause": "warn",
|
|
2323
2746
|
"playwright/no-skipped-test": "warn",
|
|
2747
|
+
"playwright/no-standalone-expect": "error",
|
|
2324
2748
|
"playwright/no-unsafe-references": "error",
|
|
2325
2749
|
"playwright/no-useless-await": "warn",
|
|
2326
2750
|
"playwright/no-useless-not": "warn",
|