eslint-plugin-react-debug 5.17.3 → 5.18.0

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +13 -13
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { DEFAULT_ESLINT_REACT_SETTINGS, getSettingsFromContext } from "@eslint-react/shared";
2
2
  import { ESLintUtils } from "@typescript-eslint/utils";
3
3
  import * as core from "@eslint-react/core";
4
- import { isUseRefCall } from "@eslint-react/core";
4
+ import { isUseRefLikeCall } from "@eslint-react/core";
5
5
  import { merge } from "@eslint-react/eslint";
6
6
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
7
7
  import { isInitializedFromReact } from "@eslint-react/var";
@@ -29,7 +29,7 @@ var __exportAll = (all, no_symbols) => {
29
29
  //#endregion
30
30
  //#region package.json
31
31
  var name$1 = "eslint-plugin-react-debug";
32
- var version = "5.17.3";
32
+ var version = "5.18.0";
33
33
 
34
34
  //#endregion
35
35
  //#region src/utils/create-rule.ts
@@ -177,13 +177,14 @@ function getRefInitNode(context, node, initialScope) {
177
177
  * @returns The init expression node if the variable is derived from a ref, or null otherwise
178
178
  */
179
179
  function getRefInit(context, name, initialScope) {
180
+ const { additionalRefHooks } = getSettingsFromContext(context);
180
181
  for (const { node } of findVariable(initialScope, name)?.defs ?? []) {
181
182
  if (node.type !== AST_NODE_TYPES.VariableDeclarator) continue;
182
183
  const init = node.init;
183
184
  if (init == null) continue;
184
185
  switch (true) {
185
186
  case init.type === AST_NODE_TYPES.MemberExpression && init.object.type === AST_NODE_TYPES.Identifier && (init.object.name === "ref" || init.object.name.endsWith("Ref")): return init;
186
- case init.type === AST_NODE_TYPES.CallExpression && isUseRefCall(context, init): return init;
187
+ case init.type === AST_NODE_TYPES.CallExpression && isUseRefLikeCall(init, additionalRefHooks): return init;
187
188
  }
188
189
  }
189
190
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "5.17.3",
3
+ "version": "5.18.0",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -37,26 +37,26 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@typescript-eslint/scope-manager": "^8.64.0",
41
- "@typescript-eslint/types": "^8.64.0",
42
- "@typescript-eslint/utils": "^8.64.0",
40
+ "@typescript-eslint/scope-manager": "^8.65.0",
41
+ "@typescript-eslint/types": "^8.65.0",
42
+ "@typescript-eslint/utils": "^8.65.0",
43
43
  "ts-pattern": "^5.9.0",
44
- "@eslint-react/eslint": "5.17.3",
45
- "@eslint-react/jsx": "5.17.3",
46
- "@eslint-react/var": "5.17.3",
47
- "@eslint-react/shared": "5.17.3",
48
- "@eslint-react/core": "5.17.3",
49
- "@eslint-react/ast": "5.17.3"
44
+ "@eslint-react/ast": "5.18.0",
45
+ "@eslint-react/core": "5.18.0",
46
+ "@eslint-react/shared": "5.18.0",
47
+ "@eslint-react/eslint": "5.18.0",
48
+ "@eslint-react/jsx": "5.18.0",
49
+ "@eslint-react/var": "5.18.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@types/react": "^19.2.17",
53
53
  "@types/react-dom": "^19.2.3",
54
54
  "dedent": "^1.7.2",
55
55
  "eslint": "^10.7.0",
56
- "tsdown": "^0.22.9",
56
+ "tsdown": "^0.22.13",
57
57
  "typescript": "6.0.3",
58
- "@local/configs": "0.0.0",
59
- "@local/eff": "0.0.0"
58
+ "@local/eff": "0.0.0",
59
+ "@local/configs": "0.0.0"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "eslint": "*",