@vitest/eslint-plugin 1.1.5 → 1.1.7
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 +1 -0
- package/dist/index.cjs +237 -181
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +237 -181
- package/package.json +4 -1
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,7 @@ function _interopNamespaceCompat(e) {
|
|
|
23
23
|
const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
|
|
24
24
|
const ts__default = /*#__PURE__*/_interopDefaultCompat(ts);
|
|
25
25
|
|
|
26
|
-
const version = "1.1.
|
|
26
|
+
const version = "1.1.6";
|
|
27
27
|
|
|
28
28
|
function createEslintRule(rule) {
|
|
29
29
|
const createRule = utils.ESLintUtils.RuleCreator(
|
|
@@ -360,12 +360,12 @@ const getFirstMatcherArg = (expectFnCall) => {
|
|
|
360
360
|
const [firstArg] = expectFnCall.args;
|
|
361
361
|
if (firstArg.type === utils.AST_NODE_TYPES.SpreadElement)
|
|
362
362
|
return firstArg;
|
|
363
|
-
return followTypeAssertionChain(firstArg);
|
|
363
|
+
return followTypeAssertionChain$1(firstArg);
|
|
364
364
|
};
|
|
365
|
-
const isTypeCastExpression = (node) => node.type === utils.AST_NODE_TYPES.TSAsExpression || node.type === utils.AST_NODE_TYPES.TSTypeAssertion;
|
|
366
|
-
const followTypeAssertionChain = (expression) => isTypeCastExpression(expression) ? followTypeAssertionChain(expression.expression) : expression;
|
|
365
|
+
const isTypeCastExpression$1 = (node) => node.type === utils.AST_NODE_TYPES.TSAsExpression || node.type === utils.AST_NODE_TYPES.TSTypeAssertion;
|
|
366
|
+
const followTypeAssertionChain$1 = (expression) => isTypeCastExpression$1(expression) ? followTypeAssertionChain$1(expression.expression) : expression;
|
|
367
367
|
|
|
368
|
-
const RULE_NAME$
|
|
368
|
+
const RULE_NAME$Y = "prefer-lowercase-title";
|
|
369
369
|
const hasStringAsFirstArgument = (node) => node.arguments[0] && isStringNode(node.arguments[0]);
|
|
370
370
|
const populateIgnores = (ignore) => {
|
|
371
371
|
const ignores = [];
|
|
@@ -384,7 +384,7 @@ const populateIgnores = (ignore) => {
|
|
|
384
384
|
return ignores;
|
|
385
385
|
};
|
|
386
386
|
const lowerCaseTitle = createEslintRule({
|
|
387
|
-
name: RULE_NAME$
|
|
387
|
+
name: RULE_NAME$Y,
|
|
388
388
|
meta: {
|
|
389
389
|
type: "problem",
|
|
390
390
|
docs: {
|
|
@@ -481,9 +481,9 @@ const lowerCaseTitle = createEslintRule({
|
|
|
481
481
|
}
|
|
482
482
|
});
|
|
483
483
|
|
|
484
|
-
const RULE_NAME$
|
|
484
|
+
const RULE_NAME$X = "max-nested-describe";
|
|
485
485
|
const maxNestedDescribe = createEslintRule({
|
|
486
|
-
name: RULE_NAME$
|
|
486
|
+
name: RULE_NAME$X,
|
|
487
487
|
meta: {
|
|
488
488
|
type: "problem",
|
|
489
489
|
docs: {
|
|
@@ -541,13 +541,13 @@ const maxNestedDescribe = createEslintRule({
|
|
|
541
541
|
}
|
|
542
542
|
});
|
|
543
543
|
|
|
544
|
-
const RULE_NAME$
|
|
544
|
+
const RULE_NAME$W = "no-identical-title";
|
|
545
545
|
const newDescribeContext = () => ({
|
|
546
546
|
describeTitles: [],
|
|
547
547
|
testTitles: []
|
|
548
548
|
});
|
|
549
549
|
const noIdenticalTitle = createEslintRule({
|
|
550
|
-
name: RULE_NAME$
|
|
550
|
+
name: RULE_NAME$W,
|
|
551
551
|
meta: {
|
|
552
552
|
type: "problem",
|
|
553
553
|
docs: {
|
|
@@ -605,7 +605,7 @@ const noIdenticalTitle = createEslintRule({
|
|
|
605
605
|
}
|
|
606
606
|
});
|
|
607
607
|
|
|
608
|
-
const RULE_NAME$
|
|
608
|
+
const RULE_NAME$V = "no-focused-tests";
|
|
609
609
|
const isTestOrDescribe = (node) => {
|
|
610
610
|
return node.type === "Identifier" && ["it", "test", "describe"].includes(node.name);
|
|
611
611
|
};
|
|
@@ -613,7 +613,7 @@ const isOnly = (node) => {
|
|
|
613
613
|
return node.type === "Identifier" && node.name === "only";
|
|
614
614
|
};
|
|
615
615
|
const noFocusedTests = createEslintRule({
|
|
616
|
-
name: RULE_NAME$
|
|
616
|
+
name: RULE_NAME$V,
|
|
617
617
|
meta: {
|
|
618
618
|
type: "problem",
|
|
619
619
|
docs: {
|
|
@@ -685,9 +685,9 @@ const noFocusedTests = createEslintRule({
|
|
|
685
685
|
}
|
|
686
686
|
});
|
|
687
687
|
|
|
688
|
-
const RULE_NAME$
|
|
688
|
+
const RULE_NAME$U = "no-conditional-tests";
|
|
689
689
|
const noConditionalTest = createEslintRule({
|
|
690
|
-
name: RULE_NAME$
|
|
690
|
+
name: RULE_NAME$U,
|
|
691
691
|
meta: {
|
|
692
692
|
type: "problem",
|
|
693
693
|
docs: {
|
|
@@ -727,7 +727,7 @@ function parsePluginSettings(settings) {
|
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
729
|
|
|
730
|
-
const RULE_NAME$
|
|
730
|
+
const RULE_NAME$T = "expect-expect";
|
|
731
731
|
function matchesAssertFunctionName(nodeName, patterns) {
|
|
732
732
|
return patterns.some(
|
|
733
733
|
(p) => new RegExp(
|
|
@@ -741,7 +741,7 @@ function matchesAssertFunctionName(nodeName, patterns) {
|
|
|
741
741
|
);
|
|
742
742
|
}
|
|
743
743
|
const expectExpect = createEslintRule({
|
|
744
|
-
name: RULE_NAME$
|
|
744
|
+
name: RULE_NAME$T,
|
|
745
745
|
meta: {
|
|
746
746
|
type: "suggestion",
|
|
747
747
|
docs: {
|
|
@@ -817,7 +817,7 @@ const expectExpect = createEslintRule({
|
|
|
817
817
|
}
|
|
818
818
|
});
|
|
819
819
|
|
|
820
|
-
const RULE_NAME$
|
|
820
|
+
const RULE_NAME$S = "consistent-test-it";
|
|
821
821
|
const buildFixer = (callee, nodeName, preferredTestKeyword) => (fixer) => [
|
|
822
822
|
fixer.replaceText(
|
|
823
823
|
callee.type === utils.AST_NODE_TYPES.MemberExpression ? callee.object : callee,
|
|
@@ -835,7 +835,7 @@ function getOppositeTestKeyword(test) {
|
|
|
835
835
|
return TestCaseName.test;
|
|
836
836
|
}
|
|
837
837
|
const consistentTestIt = createEslintRule({
|
|
838
|
-
name: RULE_NAME$
|
|
838
|
+
name: RULE_NAME$S,
|
|
839
839
|
meta: {
|
|
840
840
|
type: "suggestion",
|
|
841
841
|
fixable: "code",
|
|
@@ -933,7 +933,7 @@ const consistentTestIt = createEslintRule({
|
|
|
933
933
|
}
|
|
934
934
|
});
|
|
935
935
|
|
|
936
|
-
const RULE_NAME$
|
|
936
|
+
const RULE_NAME$R = "prefer-to-be";
|
|
937
937
|
const isNullLiteral = (node) => node.type === utils.AST_NODE_TYPES.Literal && node.value === null;
|
|
938
938
|
const isNullEqualityMatcher = (expectFnCall) => isNullLiteral(getFirstMatcherArg(expectFnCall));
|
|
939
939
|
const isFirstArgumentIdentifier = (expectFnCall, name) => isIdentifier(getFirstMatcherArg(expectFnCall), name);
|
|
@@ -969,7 +969,7 @@ const reportPreferToBe = (context, whatToBe, expectFnCall, func, modifierNode) =
|
|
|
969
969
|
});
|
|
970
970
|
};
|
|
971
971
|
const preferToBe = createEslintRule({
|
|
972
|
-
name: RULE_NAME$
|
|
972
|
+
name: RULE_NAME$R,
|
|
973
973
|
meta: {
|
|
974
974
|
type: "suggestion",
|
|
975
975
|
docs: {
|
|
@@ -1021,9 +1021,9 @@ const preferToBe = createEslintRule({
|
|
|
1021
1021
|
}
|
|
1022
1022
|
});
|
|
1023
1023
|
|
|
1024
|
-
const RULE_NAME$
|
|
1024
|
+
const RULE_NAME$Q = "no-hooks";
|
|
1025
1025
|
const noHooks = createEslintRule({
|
|
1026
|
-
name: RULE_NAME$
|
|
1026
|
+
name: RULE_NAME$Q,
|
|
1027
1027
|
meta: {
|
|
1028
1028
|
type: "suggestion",
|
|
1029
1029
|
docs: {
|
|
@@ -1062,9 +1062,9 @@ const noHooks = createEslintRule({
|
|
|
1062
1062
|
}
|
|
1063
1063
|
});
|
|
1064
1064
|
|
|
1065
|
-
const RULE_NAME$
|
|
1065
|
+
const RULE_NAME$P = "no-restricted-vi-methods";
|
|
1066
1066
|
const noRestrictedViMethods = createEslintRule({
|
|
1067
|
-
name: RULE_NAME$
|
|
1067
|
+
name: RULE_NAME$P,
|
|
1068
1068
|
meta: {
|
|
1069
1069
|
type: "suggestion",
|
|
1070
1070
|
docs: {
|
|
@@ -1104,11 +1104,11 @@ const noRestrictedViMethods = createEslintRule({
|
|
|
1104
1104
|
}
|
|
1105
1105
|
});
|
|
1106
1106
|
|
|
1107
|
-
const RULE_NAME$
|
|
1107
|
+
const RULE_NAME$O = "consistent-test-filename";
|
|
1108
1108
|
const defaultPattern = /.*\.test\.[tj]sx?$/;
|
|
1109
1109
|
const defaultTestsPattern = /.*\.(test|spec)\.[tj]sx?$/;
|
|
1110
1110
|
const consistentTestFilename = createEslintRule({
|
|
1111
|
-
name: RULE_NAME$
|
|
1111
|
+
name: RULE_NAME$O,
|
|
1112
1112
|
meta: {
|
|
1113
1113
|
type: "problem",
|
|
1114
1114
|
docs: {
|
|
@@ -1163,9 +1163,9 @@ const consistentTestFilename = createEslintRule({
|
|
|
1163
1163
|
}
|
|
1164
1164
|
});
|
|
1165
1165
|
|
|
1166
|
-
const RULE_NAME$
|
|
1166
|
+
const RULE_NAME$N = "max-expects";
|
|
1167
1167
|
const maxExpect = createEslintRule({
|
|
1168
|
-
name: RULE_NAME$
|
|
1168
|
+
name: RULE_NAME$N,
|
|
1169
1169
|
meta: {
|
|
1170
1170
|
docs: {
|
|
1171
1171
|
requiresTypeChecking: false,
|
|
@@ -1221,9 +1221,9 @@ const maxExpect = createEslintRule({
|
|
|
1221
1221
|
}
|
|
1222
1222
|
});
|
|
1223
1223
|
|
|
1224
|
-
const RULE_NAME$
|
|
1224
|
+
const RULE_NAME$M = "no-alias-methods";
|
|
1225
1225
|
const noAliasMethod = createEslintRule({
|
|
1226
|
-
name: RULE_NAME$
|
|
1226
|
+
name: RULE_NAME$M,
|
|
1227
1227
|
meta: {
|
|
1228
1228
|
docs: {
|
|
1229
1229
|
description: "disallow alias methods",
|
|
@@ -1273,12 +1273,12 @@ const noAliasMethod = createEslintRule({
|
|
|
1273
1273
|
}
|
|
1274
1274
|
});
|
|
1275
1275
|
|
|
1276
|
-
const RULE_NAME$
|
|
1276
|
+
const RULE_NAME$L = "no-commented-out-tests";
|
|
1277
1277
|
function hasTests(node) {
|
|
1278
1278
|
return /^\s*[xf]?(test|it|describe)(\.\w+|\[['"]\w+['"]\])?\s*\(/mu.test(node.value);
|
|
1279
1279
|
}
|
|
1280
1280
|
const noCommentedOutTests = createEslintRule({
|
|
1281
|
-
name: RULE_NAME$
|
|
1281
|
+
name: RULE_NAME$L,
|
|
1282
1282
|
meta: {
|
|
1283
1283
|
docs: {
|
|
1284
1284
|
description: "disallow commented out tests",
|
|
@@ -1308,10 +1308,10 @@ const noCommentedOutTests = createEslintRule({
|
|
|
1308
1308
|
}
|
|
1309
1309
|
});
|
|
1310
1310
|
|
|
1311
|
-
const RULE_NAME$
|
|
1311
|
+
const RULE_NAME$K = "no-conditional-expect";
|
|
1312
1312
|
const isCatchCall = (node) => node.callee.type === utils.AST_NODE_TYPES.MemberExpression && isSupportedAccessor(node.callee.property, "catch");
|
|
1313
1313
|
const noConditionalExpect = createEslintRule({
|
|
1314
|
-
name: RULE_NAME$
|
|
1314
|
+
name: RULE_NAME$K,
|
|
1315
1315
|
meta: {
|
|
1316
1316
|
type: "problem",
|
|
1317
1317
|
docs: {
|
|
@@ -1377,9 +1377,9 @@ const noConditionalExpect = createEslintRule({
|
|
|
1377
1377
|
}
|
|
1378
1378
|
});
|
|
1379
1379
|
|
|
1380
|
-
const RULE_NAME$
|
|
1380
|
+
const RULE_NAME$J = "no-import-node-test";
|
|
1381
1381
|
const noImportNodeTest = createEslintRule({
|
|
1382
|
-
name: RULE_NAME$
|
|
1382
|
+
name: RULE_NAME$J,
|
|
1383
1383
|
meta: {
|
|
1384
1384
|
docs: {
|
|
1385
1385
|
description: "disallow importing `node:test`",
|
|
@@ -1411,9 +1411,9 @@ const noImportNodeTest = createEslintRule({
|
|
|
1411
1411
|
}
|
|
1412
1412
|
});
|
|
1413
1413
|
|
|
1414
|
-
const RULE_NAME$
|
|
1414
|
+
const RULE_NAME$I = "no-conditional-in-test";
|
|
1415
1415
|
const noConditionalInTest = createEslintRule({
|
|
1416
|
-
name: RULE_NAME$
|
|
1416
|
+
name: RULE_NAME$I,
|
|
1417
1417
|
meta: {
|
|
1418
1418
|
docs: {
|
|
1419
1419
|
description: "disallow conditional tests",
|
|
@@ -1441,9 +1441,9 @@ const noConditionalInTest = createEslintRule({
|
|
|
1441
1441
|
}
|
|
1442
1442
|
});
|
|
1443
1443
|
|
|
1444
|
-
const RULE_NAME$
|
|
1444
|
+
const RULE_NAME$H = "no-disabled-tests";
|
|
1445
1445
|
const noDisabledTests = createEslintRule({
|
|
1446
|
-
name: RULE_NAME$
|
|
1446
|
+
name: RULE_NAME$H,
|
|
1447
1447
|
meta: {
|
|
1448
1448
|
type: "suggestion",
|
|
1449
1449
|
docs: {
|
|
@@ -1512,7 +1512,7 @@ const noDisabledTests = createEslintRule({
|
|
|
1512
1512
|
}
|
|
1513
1513
|
});
|
|
1514
1514
|
|
|
1515
|
-
const RULE_NAME$
|
|
1515
|
+
const RULE_NAME$G = "no-done-callback";
|
|
1516
1516
|
const findCallbackArg = (node, isVitestEach, context) => {
|
|
1517
1517
|
if (isVitestEach)
|
|
1518
1518
|
return node.arguments[1];
|
|
@@ -1524,7 +1524,7 @@ const findCallbackArg = (node, isVitestEach, context) => {
|
|
|
1524
1524
|
return null;
|
|
1525
1525
|
};
|
|
1526
1526
|
const noDoneCallback = createEslintRule({
|
|
1527
|
-
name: RULE_NAME$
|
|
1527
|
+
name: RULE_NAME$G,
|
|
1528
1528
|
meta: {
|
|
1529
1529
|
type: "suggestion",
|
|
1530
1530
|
docs: {
|
|
@@ -1624,9 +1624,9 @@ const noDoneCallback = createEslintRule({
|
|
|
1624
1624
|
}
|
|
1625
1625
|
});
|
|
1626
1626
|
|
|
1627
|
-
const RULE_NAME$
|
|
1627
|
+
const RULE_NAME$F = "no-duplicate-hooks";
|
|
1628
1628
|
const noDuplicateHooks = createEslintRule({
|
|
1629
|
-
name: RULE_NAME$
|
|
1629
|
+
name: RULE_NAME$F,
|
|
1630
1630
|
meta: {
|
|
1631
1631
|
docs: {
|
|
1632
1632
|
recommended: false,
|
|
@@ -1669,7 +1669,7 @@ const noDuplicateHooks = createEslintRule({
|
|
|
1669
1669
|
}
|
|
1670
1670
|
});
|
|
1671
1671
|
|
|
1672
|
-
const RULE_NAME$
|
|
1672
|
+
const RULE_NAME$E = "no-large-snapshots";
|
|
1673
1673
|
const reportOnViolation = (context, node, { maxSize: lineLimit = 50, allowedSnapshots = {} }) => {
|
|
1674
1674
|
const startLine = node.loc.start.line;
|
|
1675
1675
|
const endLine = node.loc.end.line;
|
|
@@ -1702,7 +1702,7 @@ const reportOnViolation = (context, node, { maxSize: lineLimit = 50, allowedSnap
|
|
|
1702
1702
|
}
|
|
1703
1703
|
};
|
|
1704
1704
|
const noLargeSnapshots = createEslintRule({
|
|
1705
|
-
name: RULE_NAME$
|
|
1705
|
+
name: RULE_NAME$E,
|
|
1706
1706
|
meta: {
|
|
1707
1707
|
docs: {
|
|
1708
1708
|
description: "disallow large snapshots",
|
|
@@ -1760,9 +1760,9 @@ const noLargeSnapshots = createEslintRule({
|
|
|
1760
1760
|
}
|
|
1761
1761
|
});
|
|
1762
1762
|
|
|
1763
|
-
const RULE_NAME$
|
|
1763
|
+
const RULE_NAME$D = "no-interpolation-in-snapshots";
|
|
1764
1764
|
const nonInterpolationInSnapShots = createEslintRule({
|
|
1765
|
-
name: RULE_NAME$
|
|
1765
|
+
name: RULE_NAME$D,
|
|
1766
1766
|
meta: {
|
|
1767
1767
|
type: "problem",
|
|
1768
1768
|
docs: {
|
|
@@ -1803,9 +1803,9 @@ const nonInterpolationInSnapShots = createEslintRule({
|
|
|
1803
1803
|
const mocksDirName = "__mocks__";
|
|
1804
1804
|
const isMockPath = (path$1) => path$1.split(path.posix.sep).includes(mocksDirName);
|
|
1805
1805
|
const isMockImportLiteral = (expression) => isStringNode(expression) && isMockPath(getStringValue(expression));
|
|
1806
|
-
const RULE_NAME$
|
|
1806
|
+
const RULE_NAME$C = "no-mocks-import";
|
|
1807
1807
|
const noMocksImport = createEslintRule({
|
|
1808
|
-
name: RULE_NAME$
|
|
1808
|
+
name: RULE_NAME$C,
|
|
1809
1809
|
meta: {
|
|
1810
1810
|
type: "problem",
|
|
1811
1811
|
docs: {
|
|
@@ -1833,14 +1833,14 @@ const noMocksImport = createEslintRule({
|
|
|
1833
1833
|
}
|
|
1834
1834
|
});
|
|
1835
1835
|
|
|
1836
|
-
const RULE_NAME$
|
|
1836
|
+
const RULE_NAME$B = "no-restricted-matchers";
|
|
1837
1837
|
const isChainRestricted = (chain, restriction) => {
|
|
1838
1838
|
if (ModifierName.hasOwnProperty(restriction) || restriction.endsWith(".not"))
|
|
1839
1839
|
return chain.startsWith(restriction);
|
|
1840
1840
|
return chain === restriction;
|
|
1841
1841
|
};
|
|
1842
1842
|
const noRestrictedMatchers = createEslintRule({
|
|
1843
|
-
name: RULE_NAME$
|
|
1843
|
+
name: RULE_NAME$B,
|
|
1844
1844
|
meta: {
|
|
1845
1845
|
docs: {
|
|
1846
1846
|
description: "disallow the use of certain matchers",
|
|
@@ -1886,7 +1886,7 @@ const noRestrictedMatchers = createEslintRule({
|
|
|
1886
1886
|
}
|
|
1887
1887
|
});
|
|
1888
1888
|
|
|
1889
|
-
const RULE_NAME$
|
|
1889
|
+
const RULE_NAME$A = "no-standalone-expect";
|
|
1890
1890
|
const getBlockType = (statement, context) => {
|
|
1891
1891
|
const func = statement.parent;
|
|
1892
1892
|
if (!func)
|
|
@@ -1903,7 +1903,7 @@ const getBlockType = (statement, context) => {
|
|
|
1903
1903
|
return null;
|
|
1904
1904
|
};
|
|
1905
1905
|
const noStandaloneExpect = createEslintRule({
|
|
1906
|
-
name: RULE_NAME$
|
|
1906
|
+
name: RULE_NAME$A,
|
|
1907
1907
|
meta: {
|
|
1908
1908
|
docs: {
|
|
1909
1909
|
description: "disallow using `expect` outside of `it` or `test` blocks",
|
|
@@ -1976,9 +1976,9 @@ const noStandaloneExpect = createEslintRule({
|
|
|
1976
1976
|
}
|
|
1977
1977
|
});
|
|
1978
1978
|
|
|
1979
|
-
const RULE_NAME$
|
|
1979
|
+
const RULE_NAME$z = "no-test-prefixes";
|
|
1980
1980
|
const noTestPrefixes = createEslintRule({
|
|
1981
|
-
name: RULE_NAME$
|
|
1981
|
+
name: RULE_NAME$z,
|
|
1982
1982
|
meta: {
|
|
1983
1983
|
docs: {
|
|
1984
1984
|
description: "disallow using `test` as a prefix",
|
|
@@ -2017,7 +2017,7 @@ const noTestPrefixes = createEslintRule({
|
|
|
2017
2017
|
}
|
|
2018
2018
|
});
|
|
2019
2019
|
|
|
2020
|
-
const RULE_NAME$
|
|
2020
|
+
const RULE_NAME$y = "no-test-return-statement";
|
|
2021
2021
|
const getBody = (args) => {
|
|
2022
2022
|
const [, secondArg] = args;
|
|
2023
2023
|
if (secondArg && isFunction(secondArg) && secondArg.body.type === utils.AST_NODE_TYPES.BlockStatement)
|
|
@@ -2025,7 +2025,7 @@ const getBody = (args) => {
|
|
|
2025
2025
|
return [];
|
|
2026
2026
|
};
|
|
2027
2027
|
const noTestReturnStatement = createEslintRule({
|
|
2028
|
-
name: RULE_NAME$
|
|
2028
|
+
name: RULE_NAME$y,
|
|
2029
2029
|
meta: {
|
|
2030
2030
|
type: "problem",
|
|
2031
2031
|
docs: {
|
|
@@ -2063,9 +2063,9 @@ const noTestReturnStatement = createEslintRule({
|
|
|
2063
2063
|
}
|
|
2064
2064
|
});
|
|
2065
2065
|
|
|
2066
|
-
const RULE_NAME$
|
|
2066
|
+
const RULE_NAME$x = "prefer-called-with";
|
|
2067
2067
|
const preferCalledWith = createEslintRule({
|
|
2068
|
-
name: RULE_NAME$
|
|
2068
|
+
name: RULE_NAME$x,
|
|
2069
2069
|
meta: {
|
|
2070
2070
|
docs: {
|
|
2071
2071
|
description: "enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`",
|
|
@@ -2104,7 +2104,7 @@ const preferCalledWith = createEslintRule({
|
|
|
2104
2104
|
}
|
|
2105
2105
|
});
|
|
2106
2106
|
|
|
2107
|
-
const RULE_NAME$
|
|
2107
|
+
const RULE_NAME$w = "valid-title";
|
|
2108
2108
|
const trimFXPrefix = (word) => ["f", "x"].includes(word.charAt(0)) ? word.substring(1) : word;
|
|
2109
2109
|
const quoteStringValue = (node) => node.type === utils.AST_NODE_TYPES.TemplateLiteral ? `\`${node.quasis[0].value.raw}\`` : node.raw;
|
|
2110
2110
|
const MatcherAndMessageSchema = {
|
|
@@ -2154,7 +2154,7 @@ const doesBinaryExpressionContainStringNode = (binaryExp) => {
|
|
|
2154
2154
|
return isStringNode(binaryExp.left);
|
|
2155
2155
|
};
|
|
2156
2156
|
const validTitle = createEslintRule({
|
|
2157
|
-
name: RULE_NAME$
|
|
2157
|
+
name: RULE_NAME$w,
|
|
2158
2158
|
meta: {
|
|
2159
2159
|
docs: {
|
|
2160
2160
|
description: "enforce valid titles",
|
|
@@ -2334,7 +2334,7 @@ const validTitle = createEslintRule({
|
|
|
2334
2334
|
}
|
|
2335
2335
|
});
|
|
2336
2336
|
|
|
2337
|
-
const RULE_NAME$
|
|
2337
|
+
const RULE_NAME$v = "valid-expect";
|
|
2338
2338
|
const defaultAsyncMatchers = ["toReject", "toResolve"];
|
|
2339
2339
|
const getPromiseCallExpressionNode = (node) => {
|
|
2340
2340
|
if (node.type === utils.AST_NODE_TYPES.ArrayExpression && node.parent && node.parent.type === utils.AST_NODE_TYPES.CallExpression)
|
|
@@ -2364,7 +2364,7 @@ const isAcceptableReturnNode = (node, allowReturn) => {
|
|
|
2364
2364
|
].includes(node.type);
|
|
2365
2365
|
};
|
|
2366
2366
|
const validExpect = createEslintRule({
|
|
2367
|
-
name: RULE_NAME$
|
|
2367
|
+
name: RULE_NAME$v,
|
|
2368
2368
|
meta: {
|
|
2369
2369
|
docs: {
|
|
2370
2370
|
description: "enforce valid `expect()` usage",
|
|
@@ -2538,9 +2538,9 @@ const isBooleanEqualityMatcher = (expectFnCall) => {
|
|
|
2538
2538
|
const isInstanceOfBinaryExpression = (node, className) => node.type === utils.AST_NODE_TYPES.BinaryExpression && node.operator === "instanceof" && isSupportedAccessor(node.right, className);
|
|
2539
2539
|
const hasOnlyOneArgument = (call) => call.arguments.length === 1;
|
|
2540
2540
|
|
|
2541
|
-
const RULE_NAME$
|
|
2541
|
+
const RULE_NAME$u = "prefer-to-be-object";
|
|
2542
2542
|
const preferToBeObject = createEslintRule({
|
|
2543
|
-
name: RULE_NAME$
|
|
2543
|
+
name: RULE_NAME$u,
|
|
2544
2544
|
meta: {
|
|
2545
2545
|
type: "suggestion",
|
|
2546
2546
|
docs: {
|
|
@@ -2594,7 +2594,7 @@ const preferToBeObject = createEslintRule({
|
|
|
2594
2594
|
if (vitestFnCall.args.length) {
|
|
2595
2595
|
const [matcherArg] = vitestFnCall.args;
|
|
2596
2596
|
fixes.push(fixer.remove(matcherArg));
|
|
2597
|
-
invertCondition = matcherArg.type === utils.AST_NODE_TYPES.Literal && followTypeAssertionChain(matcherArg).value === false;
|
|
2597
|
+
invertCondition = matcherArg.type === utils.AST_NODE_TYPES.Literal && followTypeAssertionChain$1(matcherArg).value === false;
|
|
2598
2598
|
}
|
|
2599
2599
|
if (invertCondition) {
|
|
2600
2600
|
const notModifier = vitestFnCall.modifiers.find((node2) => getAccessorValue(node2) === "not");
|
|
@@ -2613,10 +2613,10 @@ const preferToBeObject = createEslintRule({
|
|
|
2613
2613
|
}
|
|
2614
2614
|
});
|
|
2615
2615
|
|
|
2616
|
-
const RULE_NAME$
|
|
2616
|
+
const RULE_NAME$t = "prefer-to-be-truthy";
|
|
2617
2617
|
const isTrueLiteral = (node) => node.type === utils.AST_NODE_TYPES.Literal && node.value === true;
|
|
2618
2618
|
const preferToBeTruthy = createEslintRule({
|
|
2619
|
-
name: RULE_NAME$
|
|
2619
|
+
name: RULE_NAME$t,
|
|
2620
2620
|
meta: {
|
|
2621
2621
|
type: "suggestion",
|
|
2622
2622
|
docs: {
|
|
@@ -2651,10 +2651,10 @@ const preferToBeTruthy = createEslintRule({
|
|
|
2651
2651
|
}
|
|
2652
2652
|
});
|
|
2653
2653
|
|
|
2654
|
-
const RULE_NAME$
|
|
2654
|
+
const RULE_NAME$s = "prefer-to-be-falsy";
|
|
2655
2655
|
const isFalseLiteral = (node) => node.type === utils.AST_NODE_TYPES.Literal && node.value === false;
|
|
2656
2656
|
const preferToBeFalsy = createEslintRule({
|
|
2657
|
-
name: RULE_NAME$
|
|
2657
|
+
name: RULE_NAME$s,
|
|
2658
2658
|
meta: {
|
|
2659
2659
|
type: "suggestion",
|
|
2660
2660
|
docs: {
|
|
@@ -2689,9 +2689,9 @@ const preferToBeFalsy = createEslintRule({
|
|
|
2689
2689
|
}
|
|
2690
2690
|
});
|
|
2691
2691
|
|
|
2692
|
-
const RULE_NAME$
|
|
2692
|
+
const RULE_NAME$r = "prefer-to-have-length";
|
|
2693
2693
|
const preferToHaveLength = createEslintRule({
|
|
2694
|
-
name: RULE_NAME$
|
|
2694
|
+
name: RULE_NAME$r,
|
|
2695
2695
|
meta: {
|
|
2696
2696
|
type: "suggestion",
|
|
2697
2697
|
docs: {
|
|
@@ -2739,9 +2739,9 @@ const preferToHaveLength = createEslintRule({
|
|
|
2739
2739
|
}
|
|
2740
2740
|
});
|
|
2741
2741
|
|
|
2742
|
-
const RULE_NAME$
|
|
2742
|
+
const RULE_NAME$q = "prefer-equality-matcher";
|
|
2743
2743
|
const preferEqualityMatcher = createEslintRule({
|
|
2744
|
-
name: RULE_NAME$
|
|
2744
|
+
name: RULE_NAME$q,
|
|
2745
2745
|
meta: {
|
|
2746
2746
|
type: "suggestion",
|
|
2747
2747
|
docs: {
|
|
@@ -2813,9 +2813,9 @@ const preferEqualityMatcher = createEslintRule({
|
|
|
2813
2813
|
}
|
|
2814
2814
|
});
|
|
2815
2815
|
|
|
2816
|
-
const RULE_NAME$
|
|
2816
|
+
const RULE_NAME$p = "prefer-strict-equal";
|
|
2817
2817
|
const preferStrictEqual = createEslintRule({
|
|
2818
|
-
name: RULE_NAME$
|
|
2818
|
+
name: RULE_NAME$p,
|
|
2819
2819
|
meta: {
|
|
2820
2820
|
type: "suggestion",
|
|
2821
2821
|
docs: {
|
|
@@ -2856,9 +2856,9 @@ const preferStrictEqual = createEslintRule({
|
|
|
2856
2856
|
}
|
|
2857
2857
|
});
|
|
2858
2858
|
|
|
2859
|
-
const RULE_NAME$
|
|
2859
|
+
const RULE_NAME$o = "prefer-expect-resolves";
|
|
2860
2860
|
const preferExpectResolves = createEslintRule({
|
|
2861
|
-
name: RULE_NAME$
|
|
2861
|
+
name: RULE_NAME$o,
|
|
2862
2862
|
meta: {
|
|
2863
2863
|
type: "suggestion",
|
|
2864
2864
|
docs: {
|
|
@@ -2901,9 +2901,9 @@ const preferExpectResolves = createEslintRule({
|
|
|
2901
2901
|
})
|
|
2902
2902
|
});
|
|
2903
2903
|
|
|
2904
|
-
const RULE_NAME$
|
|
2904
|
+
const RULE_NAME$n = "prefer-each";
|
|
2905
2905
|
const preferEach = createEslintRule({
|
|
2906
|
-
name: RULE_NAME$
|
|
2906
|
+
name: RULE_NAME$n,
|
|
2907
2907
|
meta: {
|
|
2908
2908
|
type: "suggestion",
|
|
2909
2909
|
docs: {
|
|
@@ -2962,9 +2962,9 @@ const preferEach = createEslintRule({
|
|
|
2962
2962
|
}
|
|
2963
2963
|
});
|
|
2964
2964
|
|
|
2965
|
-
const RULE_NAME$
|
|
2965
|
+
const RULE_NAME$m = "prefer-hooks-on-top";
|
|
2966
2966
|
const preferHooksOnTop = createEslintRule({
|
|
2967
|
-
name: RULE_NAME$
|
|
2967
|
+
name: RULE_NAME$m,
|
|
2968
2968
|
meta: {
|
|
2969
2969
|
type: "suggestion",
|
|
2970
2970
|
docs: {
|
|
@@ -2998,10 +2998,10 @@ const preferHooksOnTop = createEslintRule({
|
|
|
2998
2998
|
}
|
|
2999
2999
|
});
|
|
3000
3000
|
|
|
3001
|
-
const RULE_NAME$
|
|
3001
|
+
const RULE_NAME$l = "prefer-hooks-in-order";
|
|
3002
3002
|
const HooksOrder = ["beforeAll", "beforeEach", "afterEach", "afterAll"];
|
|
3003
3003
|
const preferHooksInOrder = createEslintRule({
|
|
3004
|
-
name: RULE_NAME$
|
|
3004
|
+
name: RULE_NAME$l,
|
|
3005
3005
|
meta: {
|
|
3006
3006
|
type: "suggestion",
|
|
3007
3007
|
docs: {
|
|
@@ -3056,7 +3056,7 @@ const preferHooksInOrder = createEslintRule({
|
|
|
3056
3056
|
}
|
|
3057
3057
|
});
|
|
3058
3058
|
|
|
3059
|
-
const RULE_NAME$
|
|
3059
|
+
const RULE_NAME$k = "prefer-mock-promise-shorthand";
|
|
3060
3060
|
const withOnce = (name, addOnce) => {
|
|
3061
3061
|
return `${name}${addOnce ? "Once" : ""}`;
|
|
3062
3062
|
};
|
|
@@ -3068,7 +3068,7 @@ const findSingleReturnArgumentNode = (fnNode) => {
|
|
|
3068
3068
|
return null;
|
|
3069
3069
|
};
|
|
3070
3070
|
const preferMockPromiseShorthand = createEslintRule({
|
|
3071
|
-
name: RULE_NAME$
|
|
3071
|
+
name: RULE_NAME$k,
|
|
3072
3072
|
meta: {
|
|
3073
3073
|
type: "suggestion",
|
|
3074
3074
|
docs: {
|
|
@@ -3129,6 +3129,99 @@ const preferMockPromiseShorthand = createEslintRule({
|
|
|
3129
3129
|
}
|
|
3130
3130
|
});
|
|
3131
3131
|
|
|
3132
|
+
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
3133
|
+
const eslintRequire = node_module.createRequire(require$1.resolve("eslint"));
|
|
3134
|
+
eslintRequire.resolve("espree");
|
|
3135
|
+
const STATEMENT_LIST_PARENTS = /* @__PURE__ */ new Set([
|
|
3136
|
+
utils.AST_NODE_TYPES.Program,
|
|
3137
|
+
utils.AST_NODE_TYPES.BlockStatement,
|
|
3138
|
+
utils.AST_NODE_TYPES.SwitchCase,
|
|
3139
|
+
utils.AST_NODE_TYPES.SwitchStatement
|
|
3140
|
+
]);
|
|
3141
|
+
const isValidParent = (parentType) => {
|
|
3142
|
+
return STATEMENT_LIST_PARENTS.has(parentType);
|
|
3143
|
+
};
|
|
3144
|
+
const isTokenASemicolon = (token) => token.value === ";" && token.type === utils.AST_TOKEN_TYPES.Punctuator;
|
|
3145
|
+
const getActualLastToken = (sourceCode, node) => {
|
|
3146
|
+
const semiToken = sourceCode.getLastToken(node);
|
|
3147
|
+
const prevToken = sourceCode.getTokenBefore(semiToken);
|
|
3148
|
+
const nextToken = sourceCode.getTokenAfter(semiToken);
|
|
3149
|
+
const isSemicolonLessStyle = Boolean(
|
|
3150
|
+
prevToken && nextToken && prevToken.range[0] >= node.range[0] && isTokenASemicolon(semiToken) && semiToken.loc.start.line !== prevToken.loc.end.line && semiToken.loc.end.line === nextToken.loc.start.line
|
|
3151
|
+
);
|
|
3152
|
+
return isSemicolonLessStyle ? prevToken : semiToken;
|
|
3153
|
+
};
|
|
3154
|
+
const getPaddingLineSequences = (prevNode, nextNode, sourceCode) => {
|
|
3155
|
+
const pairs = [];
|
|
3156
|
+
const includeComments = true;
|
|
3157
|
+
let prevToken = getActualLastToken(sourceCode, prevNode);
|
|
3158
|
+
if (nextNode.loc.start.line - prevNode.loc.end.line >= 2) {
|
|
3159
|
+
do {
|
|
3160
|
+
const token = sourceCode.getTokenAfter(prevToken, { includeComments });
|
|
3161
|
+
if (token.loc.start.line - prevToken.loc.end.line >= 2) {
|
|
3162
|
+
pairs.push([prevToken, token]);
|
|
3163
|
+
}
|
|
3164
|
+
prevToken = token;
|
|
3165
|
+
} while (prevToken.range[0] < nextNode.range[0]);
|
|
3166
|
+
}
|
|
3167
|
+
return pairs;
|
|
3168
|
+
};
|
|
3169
|
+
const areTokensOnSameLine = (left, right) => left.loc.end.line === right.loc.start.line;
|
|
3170
|
+
const isTypeCastExpression = (node) => node.type === utils.AST_NODE_TYPES.TSAsExpression || node.type === utils.AST_NODE_TYPES.TSTypeAssertion;
|
|
3171
|
+
const followTypeAssertionChain = (expression) => isTypeCastExpression(expression) ? followTypeAssertionChain(expression.expression) : expression;
|
|
3172
|
+
|
|
3173
|
+
const RULE_NAME$j = "prefer-vi-mocked";
|
|
3174
|
+
const mockTypes = ["Mock", "MockedFunction", "MockedClass", "MockedObject"];
|
|
3175
|
+
const preferViMocked = createEslintRule({
|
|
3176
|
+
name: RULE_NAME$j,
|
|
3177
|
+
meta: {
|
|
3178
|
+
type: "suggestion",
|
|
3179
|
+
docs: {
|
|
3180
|
+
description: "Prefer `vi.mocked()` over `fn as Mock`",
|
|
3181
|
+
requiresTypeChecking: true,
|
|
3182
|
+
recommended: false
|
|
3183
|
+
},
|
|
3184
|
+
fixable: "code",
|
|
3185
|
+
messages: {
|
|
3186
|
+
useViMocked: "Prefer `vi.mocked()`"
|
|
3187
|
+
},
|
|
3188
|
+
schema: []
|
|
3189
|
+
},
|
|
3190
|
+
defaultOptions: [],
|
|
3191
|
+
create(context) {
|
|
3192
|
+
function check(node) {
|
|
3193
|
+
const { typeAnnotation } = node;
|
|
3194
|
+
if (typeAnnotation.type !== utils.AST_NODE_TYPES.TSTypeReference)
|
|
3195
|
+
return;
|
|
3196
|
+
const { typeName } = typeAnnotation;
|
|
3197
|
+
if (typeName.type !== utils.AST_NODE_TYPES.Identifier)
|
|
3198
|
+
return;
|
|
3199
|
+
if (!mockTypes.includes(typeName.name))
|
|
3200
|
+
return;
|
|
3201
|
+
const fnName = context.sourceCode.text.slice(
|
|
3202
|
+
...followTypeAssertionChain(node.expression).range
|
|
3203
|
+
);
|
|
3204
|
+
context.report({
|
|
3205
|
+
node,
|
|
3206
|
+
messageId: "useViMocked",
|
|
3207
|
+
fix(fixer) {
|
|
3208
|
+
return fixer.replaceText(node, `vi.mocked(${fnName})`);
|
|
3209
|
+
}
|
|
3210
|
+
});
|
|
3211
|
+
}
|
|
3212
|
+
return {
|
|
3213
|
+
TSAsExpression(node) {
|
|
3214
|
+
if (node.parent.type === utils.AST_NODE_TYPES.TSAsExpression)
|
|
3215
|
+
return;
|
|
3216
|
+
check(node);
|
|
3217
|
+
},
|
|
3218
|
+
TSTypeAssertion(node) {
|
|
3219
|
+
check(node);
|
|
3220
|
+
}
|
|
3221
|
+
};
|
|
3222
|
+
}
|
|
3223
|
+
});
|
|
3224
|
+
|
|
3132
3225
|
const RULE_NAME$i = "prefer-snapshot-hint";
|
|
3133
3226
|
const snapshotMatchers = ["toMatchSnapshot", "toThrowErrorMatchingSnapshot"];
|
|
3134
3227
|
const snapshotMatcherNames = snapshotMatchers;
|
|
@@ -4028,45 +4121,6 @@ const preferExpectAssertions = createEslintRule({
|
|
|
4028
4121
|
}
|
|
4029
4122
|
});
|
|
4030
4123
|
|
|
4031
|
-
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
4032
|
-
const eslintRequire = node_module.createRequire(require$1.resolve("eslint"));
|
|
4033
|
-
eslintRequire.resolve("espree");
|
|
4034
|
-
const STATEMENT_LIST_PARENTS = /* @__PURE__ */ new Set([
|
|
4035
|
-
utils.AST_NODE_TYPES.Program,
|
|
4036
|
-
utils.AST_NODE_TYPES.BlockStatement,
|
|
4037
|
-
utils.AST_NODE_TYPES.SwitchCase,
|
|
4038
|
-
utils.AST_NODE_TYPES.SwitchStatement
|
|
4039
|
-
]);
|
|
4040
|
-
const isValidParent = (parentType) => {
|
|
4041
|
-
return STATEMENT_LIST_PARENTS.has(parentType);
|
|
4042
|
-
};
|
|
4043
|
-
const isTokenASemicolon = (token) => token.value === ";" && token.type === utils.AST_TOKEN_TYPES.Punctuator;
|
|
4044
|
-
const getActualLastToken = (sourceCode, node) => {
|
|
4045
|
-
const semiToken = sourceCode.getLastToken(node);
|
|
4046
|
-
const prevToken = sourceCode.getTokenBefore(semiToken);
|
|
4047
|
-
const nextToken = sourceCode.getTokenAfter(semiToken);
|
|
4048
|
-
const isSemicolonLessStyle = Boolean(
|
|
4049
|
-
prevToken && nextToken && prevToken.range[0] >= node.range[0] && isTokenASemicolon(semiToken) && semiToken.loc.start.line !== prevToken.loc.end.line && semiToken.loc.end.line === nextToken.loc.start.line
|
|
4050
|
-
);
|
|
4051
|
-
return isSemicolonLessStyle ? prevToken : semiToken;
|
|
4052
|
-
};
|
|
4053
|
-
const getPaddingLineSequences = (prevNode, nextNode, sourceCode) => {
|
|
4054
|
-
const pairs = [];
|
|
4055
|
-
const includeComments = true;
|
|
4056
|
-
let prevToken = getActualLastToken(sourceCode, prevNode);
|
|
4057
|
-
if (nextNode.loc.start.line - prevNode.loc.end.line >= 2) {
|
|
4058
|
-
do {
|
|
4059
|
-
const token = sourceCode.getTokenAfter(prevToken, { includeComments });
|
|
4060
|
-
if (token.loc.start.line - prevToken.loc.end.line >= 2) {
|
|
4061
|
-
pairs.push([prevToken, token]);
|
|
4062
|
-
}
|
|
4063
|
-
prevToken = token;
|
|
4064
|
-
} while (prevToken.range[0] < nextNode.range[0]);
|
|
4065
|
-
}
|
|
4066
|
-
return pairs;
|
|
4067
|
-
};
|
|
4068
|
-
const areTokensOnSameLine = (left, right) => left.loc.end.line === right.loc.start.line;
|
|
4069
|
-
|
|
4070
4124
|
var PaddingType = /* @__PURE__ */ ((PaddingType2) => {
|
|
4071
4125
|
PaddingType2[PaddingType2["Any"] = 0] = "Any";
|
|
4072
4126
|
PaddingType2[PaddingType2["Always"] = 1] = "Always";
|
|
@@ -4431,17 +4485,18 @@ const createConfigLegacy = (rules) => ({
|
|
|
4431
4485
|
}, {})
|
|
4432
4486
|
});
|
|
4433
4487
|
const allRules = {
|
|
4488
|
+
[RULE_NAME$Y]: "warn",
|
|
4434
4489
|
[RULE_NAME$X]: "warn",
|
|
4435
|
-
[RULE_NAME$
|
|
4490
|
+
[RULE_NAME$V]: "warn",
|
|
4436
4491
|
[RULE_NAME$U]: "warn",
|
|
4437
|
-
[RULE_NAME$
|
|
4438
|
-
[RULE_NAME$
|
|
4492
|
+
[RULE_NAME$S]: "warn",
|
|
4493
|
+
[RULE_NAME$Q]: "warn",
|
|
4439
4494
|
[RULE_NAME$P]: "warn",
|
|
4440
4495
|
[RULE_NAME$O]: "warn",
|
|
4441
4496
|
[RULE_NAME$N]: "warn",
|
|
4442
4497
|
[RULE_NAME$M]: "warn",
|
|
4443
|
-
[RULE_NAME$
|
|
4444
|
-
[RULE_NAME$
|
|
4498
|
+
[RULE_NAME$K]: "warn",
|
|
4499
|
+
[RULE_NAME$I]: "warn",
|
|
4445
4500
|
[RULE_NAME$H]: "warn",
|
|
4446
4501
|
[RULE_NAME$G]: "warn",
|
|
4447
4502
|
[RULE_NAME$F]: "warn",
|
|
@@ -4453,10 +4508,10 @@ const allRules = {
|
|
|
4453
4508
|
[RULE_NAME$z]: "warn",
|
|
4454
4509
|
[RULE_NAME$y]: "warn",
|
|
4455
4510
|
[RULE_NAME$x]: "warn",
|
|
4456
|
-
[RULE_NAME$w]: "warn",
|
|
4457
|
-
[RULE_NAME$r]: "warn",
|
|
4458
|
-
[RULE_NAME$t]: "warn",
|
|
4459
4511
|
[RULE_NAME$s]: "warn",
|
|
4512
|
+
[RULE_NAME$u]: "warn",
|
|
4513
|
+
[RULE_NAME$t]: "warn",
|
|
4514
|
+
[RULE_NAME$r]: "warn",
|
|
4460
4515
|
[RULE_NAME$q]: "warn",
|
|
4461
4516
|
[RULE_NAME$p]: "warn",
|
|
4462
4517
|
[RULE_NAME$o]: "warn",
|
|
@@ -4474,7 +4529,7 @@ const allRules = {
|
|
|
4474
4529
|
[RULE_NAME$a]: "warn",
|
|
4475
4530
|
[RULE_NAME$9]: "warn",
|
|
4476
4531
|
[RULE_NAME$8]: "warn",
|
|
4477
|
-
[RULE_NAME$
|
|
4532
|
+
[RULE_NAME$R]: "warn",
|
|
4478
4533
|
[RULE_NAME$7]: "warn",
|
|
4479
4534
|
[RULE_NAME$6]: "warn",
|
|
4480
4535
|
[RULE_NAME]: "warn",
|
|
@@ -4485,14 +4540,14 @@ const allRules = {
|
|
|
4485
4540
|
[RULE_NAME$1]: "warn"
|
|
4486
4541
|
};
|
|
4487
4542
|
const recommended = {
|
|
4488
|
-
[RULE_NAME$
|
|
4489
|
-
[RULE_NAME$
|
|
4490
|
-
[RULE_NAME$
|
|
4543
|
+
[RULE_NAME$T]: "error",
|
|
4544
|
+
[RULE_NAME$W]: "error",
|
|
4545
|
+
[RULE_NAME$L]: "error",
|
|
4546
|
+
[RULE_NAME$w]: "error",
|
|
4491
4547
|
[RULE_NAME$v]: "error",
|
|
4492
|
-
[RULE_NAME$u]: "error",
|
|
4493
4548
|
[RULE_NAME$h]: "error",
|
|
4494
4549
|
[RULE_NAME$d]: "error",
|
|
4495
|
-
[RULE_NAME$
|
|
4550
|
+
[RULE_NAME$J]: "error"
|
|
4496
4551
|
};
|
|
4497
4552
|
const plugin = {
|
|
4498
4553
|
meta: {
|
|
@@ -4500,48 +4555,49 @@ const plugin = {
|
|
|
4500
4555
|
version
|
|
4501
4556
|
},
|
|
4502
4557
|
rules: {
|
|
4503
|
-
[RULE_NAME$
|
|
4504
|
-
[RULE_NAME$
|
|
4505
|
-
[RULE_NAME$
|
|
4506
|
-
[RULE_NAME$
|
|
4507
|
-
[RULE_NAME$
|
|
4508
|
-
[RULE_NAME$
|
|
4509
|
-
[RULE_NAME$
|
|
4510
|
-
[RULE_NAME$
|
|
4511
|
-
[RULE_NAME$
|
|
4512
|
-
[RULE_NAME$
|
|
4513
|
-
[RULE_NAME$
|
|
4514
|
-
[RULE_NAME$
|
|
4515
|
-
[RULE_NAME$
|
|
4516
|
-
[RULE_NAME$
|
|
4517
|
-
[RULE_NAME$
|
|
4518
|
-
[RULE_NAME$
|
|
4519
|
-
[RULE_NAME$
|
|
4520
|
-
[RULE_NAME$
|
|
4521
|
-
[RULE_NAME$
|
|
4522
|
-
[RULE_NAME$
|
|
4523
|
-
[RULE_NAME$
|
|
4524
|
-
[RULE_NAME$
|
|
4525
|
-
[RULE_NAME$
|
|
4526
|
-
[RULE_NAME$
|
|
4527
|
-
[RULE_NAME$
|
|
4528
|
-
[RULE_NAME$
|
|
4529
|
-
[RULE_NAME$
|
|
4530
|
-
[RULE_NAME$
|
|
4531
|
-
[RULE_NAME$
|
|
4532
|
-
[RULE_NAME$
|
|
4533
|
-
[RULE_NAME$
|
|
4534
|
-
[RULE_NAME$
|
|
4535
|
-
[RULE_NAME$
|
|
4536
|
-
[RULE_NAME$
|
|
4537
|
-
[RULE_NAME$
|
|
4538
|
-
[RULE_NAME$
|
|
4539
|
-
[RULE_NAME$
|
|
4540
|
-
[RULE_NAME$
|
|
4541
|
-
[RULE_NAME$
|
|
4542
|
-
[RULE_NAME$
|
|
4558
|
+
[RULE_NAME$Y]: lowerCaseTitle,
|
|
4559
|
+
[RULE_NAME$X]: maxNestedDescribe,
|
|
4560
|
+
[RULE_NAME$W]: noIdenticalTitle,
|
|
4561
|
+
[RULE_NAME$V]: noFocusedTests,
|
|
4562
|
+
[RULE_NAME$U]: noConditionalTest,
|
|
4563
|
+
[RULE_NAME$T]: expectExpect,
|
|
4564
|
+
[RULE_NAME$S]: consistentTestIt,
|
|
4565
|
+
[RULE_NAME$R]: preferToBe,
|
|
4566
|
+
[RULE_NAME$Q]: noHooks,
|
|
4567
|
+
[RULE_NAME$P]: noRestrictedViMethods,
|
|
4568
|
+
[RULE_NAME$O]: consistentTestFilename,
|
|
4569
|
+
[RULE_NAME$N]: maxExpect,
|
|
4570
|
+
[RULE_NAME$M]: noAliasMethod,
|
|
4571
|
+
[RULE_NAME$L]: noCommentedOutTests,
|
|
4572
|
+
[RULE_NAME$K]: noConditionalExpect,
|
|
4573
|
+
[RULE_NAME$I]: noConditionalInTest,
|
|
4574
|
+
[RULE_NAME$H]: noDisabledTests,
|
|
4575
|
+
[RULE_NAME$G]: noDoneCallback,
|
|
4576
|
+
[RULE_NAME$F]: noDuplicateHooks,
|
|
4577
|
+
[RULE_NAME$E]: noLargeSnapshots,
|
|
4578
|
+
[RULE_NAME$D]: nonInterpolationInSnapShots,
|
|
4579
|
+
[RULE_NAME$C]: noMocksImport,
|
|
4580
|
+
[RULE_NAME$B]: noRestrictedMatchers,
|
|
4581
|
+
[RULE_NAME$A]: noStandaloneExpect,
|
|
4582
|
+
[RULE_NAME$z]: noTestPrefixes,
|
|
4583
|
+
[RULE_NAME$y]: noTestReturnStatement,
|
|
4584
|
+
[RULE_NAME$J]: noImportNodeTest,
|
|
4585
|
+
[RULE_NAME$x]: preferCalledWith,
|
|
4586
|
+
[RULE_NAME$w]: validTitle,
|
|
4587
|
+
[RULE_NAME$v]: validExpect,
|
|
4588
|
+
[RULE_NAME$s]: preferToBeFalsy,
|
|
4589
|
+
[RULE_NAME$u]: preferToBeObject,
|
|
4590
|
+
[RULE_NAME$t]: preferToBeTruthy,
|
|
4591
|
+
[RULE_NAME$r]: preferToHaveLength,
|
|
4592
|
+
[RULE_NAME$q]: preferEqualityMatcher,
|
|
4593
|
+
[RULE_NAME$p]: preferStrictEqual,
|
|
4594
|
+
[RULE_NAME$o]: preferExpectResolves,
|
|
4595
|
+
[RULE_NAME$n]: preferEach,
|
|
4596
|
+
[RULE_NAME$m]: preferHooksOnTop,
|
|
4597
|
+
[RULE_NAME$l]: preferHooksInOrder,
|
|
4543
4598
|
[RULE_NAME$d]: requireLocalTestContextForConcurrentSnapshots,
|
|
4544
|
-
[RULE_NAME$
|
|
4599
|
+
[RULE_NAME$k]: preferMockPromiseShorthand,
|
|
4600
|
+
[RULE_NAME$j]: preferViMocked,
|
|
4545
4601
|
[RULE_NAME$i]: preferSnapshotHint,
|
|
4546
4602
|
[RULE_NAME$h]: validDescribeCallback,
|
|
4547
4603
|
[RULE_NAME$g]: requireTopLevelDescribe,
|