@vitest/eslint-plugin 1.3.25 → 1.3.26
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 +12 -8
- package/dist/index.d.ts +0 -1
- package/dist/index.js +8 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -23,17 +23,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
//#endregion
|
|
24
24
|
let __typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
25
25
|
__typescript_eslint_utils = __toESM(__typescript_eslint_utils);
|
|
26
|
-
let typescript = require("typescript");
|
|
27
|
-
typescript = __toESM(typescript);
|
|
28
|
-
let node_path = require("node:path");
|
|
29
|
-
node_path = __toESM(node_path);
|
|
30
26
|
let node_module = require("node:module");
|
|
31
27
|
node_module = __toESM(node_module);
|
|
28
|
+
let node_path = require("node:path");
|
|
29
|
+
node_path = __toESM(node_path);
|
|
32
30
|
let __typescript_eslint_scope_manager = require("@typescript-eslint/scope-manager");
|
|
33
31
|
__typescript_eslint_scope_manager = __toESM(__typescript_eslint_scope_manager);
|
|
34
32
|
|
|
35
33
|
//#region package.json
|
|
36
|
-
var version = "1.3.
|
|
34
|
+
var version = "1.3.26";
|
|
37
35
|
|
|
38
36
|
//#endregion
|
|
39
37
|
//#region src/utils/index.ts
|
|
@@ -111,6 +109,10 @@ const isParsedInstanceOfMatcherCall = (expectFnCall, classArg) => {
|
|
|
111
109
|
return getAccessorValue(expectFnCall.matcher) === "toBeInstanceOf" && expectFnCall.args.length === 1 && isSupportedAccessor(expectFnCall.args[0], classArg);
|
|
112
110
|
};
|
|
113
111
|
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/utils/require.ts
|
|
114
|
+
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
115
|
+
|
|
114
116
|
//#endregion
|
|
115
117
|
//#region src/utils/types.ts
|
|
116
118
|
let UtilName = /* @__PURE__ */ function(UtilName$1) {
|
|
@@ -165,7 +167,8 @@ let EqualityMatcher = /* @__PURE__ */ function(EqualityMatcher$1) {
|
|
|
165
167
|
}({});
|
|
166
168
|
function isClassOrFunctionType(type) {
|
|
167
169
|
if (type.getCallSignatures().length > 0) return true;
|
|
168
|
-
|
|
170
|
+
const ts = require$1("typescript");
|
|
171
|
+
return type.getSymbol()?.getDeclarations()?.some((declaration) => ts.isArrowFunction(declaration) || ts.isClassDeclaration(declaration) || ts.isClassExpression(declaration) || ts.isFunctionDeclaration(declaration) || ts.isFunctionExpression(declaration) || ts.isMethodDeclaration(declaration) || ts.isFunctionTypeNode(declaration)) ?? false;
|
|
169
172
|
}
|
|
170
173
|
|
|
171
174
|
//#endregion
|
|
@@ -3235,7 +3238,7 @@ var no_done_callback_default = createEslintRule({
|
|
|
3235
3238
|
defaultOptions: [],
|
|
3236
3239
|
create(context) {
|
|
3237
3240
|
return { CallExpression(node) {
|
|
3238
|
-
const isVitestEach = /\.each$|\.concurrent$/.test(getNodeName(node.callee) ?? "");
|
|
3241
|
+
const isVitestEach = /\.each$|\.for$|\.concurrent$/.test(getNodeName(node.callee) ?? "");
|
|
3239
3242
|
if (isVitestEach && node.callee.type !== __typescript_eslint_utils.AST_NODE_TYPES.TaggedTemplateExpression) return;
|
|
3240
3243
|
if (context.sourceCode.getAncestors(node).some((ancestor) => {
|
|
3241
3244
|
if (ancestor.type !== __typescript_eslint_utils.AST_NODE_TYPES.CallExpression) return false;
|
|
@@ -3724,7 +3727,8 @@ const compileMatcherPattern = (matcherMaybeWithMessage) => {
|
|
|
3724
3727
|
return [new RegExp(matcher, "u"), message];
|
|
3725
3728
|
};
|
|
3726
3729
|
function isStringLikeType(type) {
|
|
3727
|
-
|
|
3730
|
+
const ts = require$1("typescript");
|
|
3731
|
+
return !!(type.flags & ts.TypeFlags.StringLike);
|
|
3728
3732
|
}
|
|
3729
3733
|
const compileMatcherPatterns = (matchers) => {
|
|
3730
3734
|
if (typeof matchers === "string" || Array.isArray(matchers)) {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { AST_NODE_TYPES, AST_TOKEN_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
3
|
-
import ts from "typescript";
|
|
4
3
|
import { isAbsolute, posix } from "node:path";
|
|
5
4
|
import { DefinitionType } from "@typescript-eslint/scope-manager";
|
|
6
5
|
|
|
7
6
|
//#region package.json
|
|
8
|
-
var version = "1.3.
|
|
7
|
+
var version = "1.3.26";
|
|
9
8
|
|
|
10
9
|
//#endregion
|
|
11
10
|
//#region src/utils/index.ts
|
|
@@ -83,6 +82,10 @@ const isParsedInstanceOfMatcherCall = (expectFnCall, classArg) => {
|
|
|
83
82
|
return getAccessorValue(expectFnCall.matcher) === "toBeInstanceOf" && expectFnCall.args.length === 1 && isSupportedAccessor(expectFnCall.args[0], classArg);
|
|
84
83
|
};
|
|
85
84
|
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/utils/require.ts
|
|
87
|
+
const require = createRequire(import.meta.url);
|
|
88
|
+
|
|
86
89
|
//#endregion
|
|
87
90
|
//#region src/utils/types.ts
|
|
88
91
|
let UtilName = /* @__PURE__ */ function(UtilName$1) {
|
|
@@ -137,6 +140,7 @@ let EqualityMatcher = /* @__PURE__ */ function(EqualityMatcher$1) {
|
|
|
137
140
|
}({});
|
|
138
141
|
function isClassOrFunctionType(type) {
|
|
139
142
|
if (type.getCallSignatures().length > 0) return true;
|
|
143
|
+
const ts = require("typescript");
|
|
140
144
|
return type.getSymbol()?.getDeclarations()?.some((declaration) => ts.isArrowFunction(declaration) || ts.isClassDeclaration(declaration) || ts.isClassExpression(declaration) || ts.isFunctionDeclaration(declaration) || ts.isFunctionExpression(declaration) || ts.isMethodDeclaration(declaration) || ts.isFunctionTypeNode(declaration)) ?? false;
|
|
141
145
|
}
|
|
142
146
|
|
|
@@ -3207,7 +3211,7 @@ var no_done_callback_default = createEslintRule({
|
|
|
3207
3211
|
defaultOptions: [],
|
|
3208
3212
|
create(context) {
|
|
3209
3213
|
return { CallExpression(node) {
|
|
3210
|
-
const isVitestEach = /\.each$|\.concurrent$/.test(getNodeName(node.callee) ?? "");
|
|
3214
|
+
const isVitestEach = /\.each$|\.for$|\.concurrent$/.test(getNodeName(node.callee) ?? "");
|
|
3211
3215
|
if (isVitestEach && node.callee.type !== AST_NODE_TYPES.TaggedTemplateExpression) return;
|
|
3212
3216
|
if (context.sourceCode.getAncestors(node).some((ancestor) => {
|
|
3213
3217
|
if (ancestor.type !== AST_NODE_TYPES.CallExpression) return false;
|
|
@@ -3696,6 +3700,7 @@ const compileMatcherPattern = (matcherMaybeWithMessage) => {
|
|
|
3696
3700
|
return [new RegExp(matcher, "u"), message];
|
|
3697
3701
|
};
|
|
3698
3702
|
function isStringLikeType(type) {
|
|
3703
|
+
const ts = require("typescript");
|
|
3699
3704
|
return !!(type.flags & ts.TypeFlags.StringLike);
|
|
3700
3705
|
}
|
|
3701
3706
|
const compileMatcherPatterns = (matchers) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest/eslint-plugin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ESLint plugin for Vitest",
|
|
6
6
|
"repository": "vitest-dev/eslint-plugin-vitest",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"eslint-remote-tester-repositories": "^2.0.2",
|
|
49
49
|
"jiti": "^2.6.1",
|
|
50
50
|
"prettier": "^3.6.2",
|
|
51
|
-
"tsdown": "^0.15.
|
|
51
|
+
"tsdown": "^0.15.10",
|
|
52
52
|
"tsx": "^4.20.6",
|
|
53
53
|
"typescript": "^5.9.3",
|
|
54
54
|
"typescript-eslint": "^8.46.1",
|