@vitest/eslint-plugin 1.0.4 → 1.0.5
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.cjs +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -24,7 +24,7 @@ function _interopNamespaceCompat(e) {
|
|
|
24
24
|
const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
|
|
25
25
|
const ts__default = /*#__PURE__*/_interopDefaultCompat(ts);
|
|
26
26
|
|
|
27
|
-
const version = "1.0.
|
|
27
|
+
const version = "1.0.4";
|
|
28
28
|
|
|
29
29
|
function createEslintRule(rule) {
|
|
30
30
|
const createRule = utils.ESLintUtils.RuleCreator(
|
|
@@ -2478,6 +2478,13 @@ const validExpect = createEslintRule({
|
|
|
2478
2478
|
});
|
|
2479
2479
|
}
|
|
2480
2480
|
if (expect.arguments.length > maxArgs) {
|
|
2481
|
+
if (expect.arguments.length === 2) {
|
|
2482
|
+
const isSecondArgString = expect.arguments[1].type === utils.AST_NODE_TYPES.Literal && typeof expect.arguments[1].value === "string";
|
|
2483
|
+
const isSecondArgTemplateLiteral = expect.arguments[1].type === utils.AST_NODE_TYPES.TemplateLiteral;
|
|
2484
|
+
if (isSecondArgString || isSecondArgTemplateLiteral) {
|
|
2485
|
+
return;
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2481
2488
|
const { start } = expect.arguments[maxArgs].loc;
|
|
2482
2489
|
const { end } = expect.arguments[expect.arguments.length - 1].loc;
|
|
2483
2490
|
const loc = {
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import ts from 'typescript';
|
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
|
|
8
|
-
const version = "1.0.
|
|
8
|
+
const version = "1.0.4";
|
|
9
9
|
|
|
10
10
|
function createEslintRule(rule) {
|
|
11
11
|
const createRule = ESLintUtils.RuleCreator(
|
|
@@ -2459,6 +2459,13 @@ const validExpect = createEslintRule({
|
|
|
2459
2459
|
});
|
|
2460
2460
|
}
|
|
2461
2461
|
if (expect.arguments.length > maxArgs) {
|
|
2462
|
+
if (expect.arguments.length === 2) {
|
|
2463
|
+
const isSecondArgString = expect.arguments[1].type === AST_NODE_TYPES.Literal && typeof expect.arguments[1].value === "string";
|
|
2464
|
+
const isSecondArgTemplateLiteral = expect.arguments[1].type === AST_NODE_TYPES.TemplateLiteral;
|
|
2465
|
+
if (isSecondArgString || isSecondArgTemplateLiteral) {
|
|
2466
|
+
return;
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2462
2469
|
const { start } = expect.arguments[maxArgs].loc;
|
|
2463
2470
|
const { end } = expect.arguments[expect.arguments.length - 1].loc;
|
|
2464
2471
|
const loc = {
|