@vitest/eslint-plugin 1.6.11 → 1.6.12

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 CHANGED
@@ -1,10 +1,10 @@
1
1
  let _typescript_eslint_utils = require("@typescript-eslint/utils");
2
- let node_module = require("node:module");
3
2
  let node_path = require("node:path");
3
+ let node_module = require("node:module");
4
4
  let _typescript_eslint_scope_manager = require("@typescript-eslint/scope-manager");
5
5
 
6
6
  //#region package.json
7
- var version = "1.6.11";
7
+ var version = "1.6.12";
8
8
 
9
9
  //#endregion
10
10
  //#region src/utils/index.ts
@@ -82,10 +82,6 @@ const isParsedInstanceOfMatcherCall = (expectFnCall, classArg) => {
82
82
  return getAccessorValue(expectFnCall.matcher) === "toBeInstanceOf" && expectFnCall.args.length === 1 && isSupportedAccessor(expectFnCall.args[0], classArg);
83
83
  };
84
84
 
85
- //#endregion
86
- //#region src/utils/require.ts
87
- const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
88
-
89
85
  //#endregion
90
86
  //#region src/utils/types.ts
91
87
  let UtilName = /* @__PURE__ */ function(UtilName) {
@@ -139,9 +135,7 @@ let EqualityMatcher = /* @__PURE__ */ function(EqualityMatcher) {
139
135
  return EqualityMatcher;
140
136
  }({});
141
137
  function isClassOrFunctionType(type) {
142
- if (type.getCallSignatures().length > 0) return true;
143
- const ts = require$1("typescript");
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;
138
+ return type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0;
145
139
  }
146
140
 
147
141
  //#endregion
@@ -2392,7 +2386,7 @@ var no_alias_methods_default = createEslintRule({
2392
2386
  toReturnWith: "toHaveReturnedWith",
2393
2387
  lastReturnedWith: "toHaveLastReturnedWith",
2394
2388
  nthReturnedWith: "toHaveNthReturnedWith",
2395
- toThrow: "toThrowError"
2389
+ toThrowError: "toThrow"
2396
2390
  };
2397
2391
  return { CallExpression(node) {
2398
2392
  const vitestFnCall = parseVitestFnCall(node, context);
@@ -6466,6 +6460,10 @@ var valid_expect_default = createEslintRule({
6466
6460
  }
6467
6461
  });
6468
6462
 
6463
+ //#endregion
6464
+ //#region src/utils/require.ts
6465
+ const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
6466
+
6469
6467
  //#endregion
6470
6468
  //#region src/rules/valid-title.ts
6471
6469
  const RULE_NAME$3 = "valid-title";
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { isAbsolute, posix } from "node:path";
4
4
  import { DefinitionType } from "@typescript-eslint/scope-manager";
5
5
 
6
6
  //#region package.json
7
- var version = "1.6.11";
7
+ var version = "1.6.12";
8
8
 
9
9
  //#endregion
10
10
  //#region src/utils/index.ts
@@ -82,10 +82,6 @@ const isParsedInstanceOfMatcherCall = (expectFnCall, classArg) => {
82
82
  return getAccessorValue(expectFnCall.matcher) === "toBeInstanceOf" && expectFnCall.args.length === 1 && isSupportedAccessor(expectFnCall.args[0], classArg);
83
83
  };
84
84
 
85
- //#endregion
86
- //#region src/utils/require.ts
87
- const require = createRequire(import.meta.url);
88
-
89
85
  //#endregion
90
86
  //#region src/utils/types.ts
91
87
  let UtilName = /* @__PURE__ */ function(UtilName) {
@@ -139,9 +135,7 @@ let EqualityMatcher = /* @__PURE__ */ function(EqualityMatcher) {
139
135
  return EqualityMatcher;
140
136
  }({});
141
137
  function isClassOrFunctionType(type) {
142
- if (type.getCallSignatures().length > 0) return true;
143
- const ts = require("typescript");
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;
138
+ return type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0;
145
139
  }
146
140
 
147
141
  //#endregion
@@ -2392,7 +2386,7 @@ var no_alias_methods_default = createEslintRule({
2392
2386
  toReturnWith: "toHaveReturnedWith",
2393
2387
  lastReturnedWith: "toHaveLastReturnedWith",
2394
2388
  nthReturnedWith: "toHaveNthReturnedWith",
2395
- toThrow: "toThrowError"
2389
+ toThrowError: "toThrow"
2396
2390
  };
2397
2391
  return { CallExpression(node) {
2398
2392
  const vitestFnCall = parseVitestFnCall(node, context);
@@ -6466,6 +6460,10 @@ var valid_expect_default = createEslintRule({
6466
6460
  }
6467
6461
  });
6468
6462
 
6463
+ //#endregion
6464
+ //#region src/utils/require.ts
6465
+ const require = createRequire(import.meta.url);
6466
+
6469
6467
  //#endregion
6470
6468
  //#region src/rules/valid-title.ts
6471
6469
  const RULE_NAME$3 = "valid-title";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest/eslint-plugin",
3
- "version": "1.6.11",
3
+ "version": "1.6.12",
4
4
  "license": "MIT",
5
5
  "description": "ESLint plugin for Vitest",
6
6
  "repository": "vitest-dev/eslint-plugin-vitest",