@eslint-react/kit 2.0.0-next.137 → 2.0.0-next.138

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.d.ts CHANGED
@@ -20,19 +20,27 @@ declare function isProcessEnvNodeEnv(node: TSESTree.Node | null | unit): node is
20
20
  * @returns True if the node is a binary expression that compares `process.env.NODE_ENV` with the specified value, false otherwise
21
21
  */
22
22
  declare function isProcessEnvNodeEnvCompare(node: TSESTree.Node | null | unit, operator: "===" | "!==", value: "development" | "production"): node is TSESTree.BinaryExpression;
23
+ /**
24
+ * Checks if the given node is a `vi.mock`.
25
+ * @param node The node to check
26
+ * @returns `true` if the node is a `vi.mock`, otherwise `false`.
27
+ * @internal
28
+ */
29
+ declare function isViMock(node: TSESTree.Node | null | unit): node is TSESTree.MemberExpression;
23
30
  /**
24
31
  * Checks if the given node is a `vi.mock` callback.
25
32
  * @param node The node to check
26
33
  * @returns `true` if the node is a `vi.mock` callback, otherwise `false`.
27
34
  * @internal
28
35
  */
29
- declare function isViMockCallback(node: TSESTree.Node | null | unit): node is TSESTree.FunctionExpression;
36
+ declare function isViMockCallback(node: TSESTree.Node | null | unit): boolean;
30
37
 
31
38
  declare const ContextDetection_isProcessEnvNodeEnv: typeof isProcessEnvNodeEnv;
32
39
  declare const ContextDetection_isProcessEnvNodeEnvCompare: typeof isProcessEnvNodeEnvCompare;
40
+ declare const ContextDetection_isViMock: typeof isViMock;
33
41
  declare const ContextDetection_isViMockCallback: typeof isViMockCallback;
34
42
  declare namespace ContextDetection {
35
- export { ContextDetection_isProcessEnvNodeEnv as isProcessEnvNodeEnv, ContextDetection_isProcessEnvNodeEnvCompare as isProcessEnvNodeEnvCompare, ContextDetection_isViMockCallback as isViMockCallback };
43
+ export { ContextDetection_isProcessEnvNodeEnv as isProcessEnvNodeEnv, ContextDetection_isProcessEnvNodeEnvCompare as isProcessEnvNodeEnvCompare, ContextDetection_isViMock as isViMock, ContextDetection_isViMockCallback as isViMockCallback };
36
44
  }
37
45
 
38
46
  /**
package/dist/index.js CHANGED
@@ -327,6 +327,7 @@ var ContextDetection_exports = {};
327
327
  __export(ContextDetection_exports, {
328
328
  isProcessEnvNodeEnv: () => isProcessEnvNodeEnv,
329
329
  isProcessEnvNodeEnvCompare: () => isProcessEnvNodeEnvCompare,
330
+ isViMock: () => isViMock,
330
331
  isViMockCallback: () => isViMockCallback
331
332
  });
332
333
  var import_types = __toESM(require_dist());
@@ -345,8 +346,11 @@ function isProcessEnvNodeEnvCompare(node, operator, value) {
345
346
  }
346
347
  return false;
347
348
  }
349
+ function isViMock(node) {
350
+ return node != null && node.type === import_types.AST_NODE_TYPES.MemberExpression && node.object.type === import_types.AST_NODE_TYPES.Identifier && node.object.name === "vi" && node.property.type === import_types.AST_NODE_TYPES.Identifier && node.property.name === "mock";
351
+ }
348
352
  function isViMockCallback(node) {
349
- return node != null && node.type === import_types.AST_NODE_TYPES.FunctionExpression && node.parent.type === import_types.AST_NODE_TYPES.CallExpression && node.parent.callee.type === import_types.AST_NODE_TYPES.MemberExpression && node.parent.callee.object.type === import_types.AST_NODE_TYPES.Identifier && node.parent.callee.object.name === "vi" && node.parent.callee.property.type === import_types.AST_NODE_TYPES.Identifier && node.parent.callee.property.name === "mock" && node.parent.arguments[1] === node;
353
+ return node != null && AST.isFunction(node) && node.parent.type === import_types.AST_NODE_TYPES.CallExpression && isViMock(node.parent.callee) && node.parent.arguments[1] === node;
350
354
  }
351
355
 
352
356
  // src/JsxConfig/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/kit",
3
- "version": "2.0.0-next.137",
3
+ "version": "2.0.0-next.138",
4
4
  "description": "ESLint React's plugin kit for building plugins and rules.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -30,8 +30,8 @@
30
30
  "@typescript-eslint/utils": "^8.40.0",
31
31
  "ts-pattern": "^5.8.0",
32
32
  "zod": "^4.0.17",
33
- "@eslint-react/eff": "2.0.0-next.137",
34
- "@eslint-react/ast": "2.0.0-next.137"
33
+ "@eslint-react/eff": "2.0.0-next.138",
34
+ "@eslint-react/ast": "2.0.0-next.138"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@tsconfig/node22": "^22.0.2",