eslint-plugin-react-debug 5.9.5 → 5.10.1

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 +11 -10
  2. package/package.json +11 -11
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import * as core from "@eslint-react/core";
4
4
  import { isUseRefCall } from "@eslint-react/core";
5
5
  import { merge } from "@eslint-react/eslint";
6
6
  import { AST_NODE_TYPES } from "@typescript-eslint/types";
7
+ import { isInitializedFromReact } from "@eslint-react/var";
7
8
  import { findVariable } from "@typescript-eslint/utils/ast-utils";
8
9
  import { getElementFullType, isFragmentElement } from "@eslint-react/jsx";
9
10
  import { P, match } from "ts-pattern";
@@ -28,7 +29,7 @@ var __exportAll = (all, no_symbols) => {
28
29
  //#endregion
29
30
  //#region package.json
30
31
  var name$1 = "eslint-plugin-react-debug";
31
- var version = "5.9.5";
32
+ var version = "5.10.1";
32
33
 
33
34
  //#endregion
34
35
  //#region src/utils/create-rule.ts
@@ -117,9 +118,9 @@ function create$3(context) {
117
118
  function isFromReact(node, initialScope, importSource = "react") {
118
119
  const name = node.name;
119
120
  switch (true) {
120
- case node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier: return core.isAPIFromReact(node.parent.object.name, initialScope, importSource);
121
- case node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier: return core.isAPIFromReact(node.parent.object.name, initialScope, importSource);
122
- default: return core.isAPIFromReact(name, initialScope, importSource);
121
+ case node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier: return isInitializedFromReact(node.parent.object.name, initialScope, importSource);
122
+ case node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier: return isInitializedFromReact(node.parent.object.name, initialScope, importSource);
123
+ default: return isInitializedFromReact(name, initialScope, importSource);
123
124
  }
124
125
  }
125
126
 
@@ -139,7 +140,7 @@ var is_from_react_default = createRule({
139
140
  });
140
141
  function create$2(context) {
141
142
  const { importSource } = getSettingsFromContext(context);
142
- function visitorFunction(node) {
143
+ function visit(node) {
143
144
  if (node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name) return;
144
145
  const name = node.name;
145
146
  if (!isFromReact(node, context.sourceCode.getScope(node), importSource)) return;
@@ -153,8 +154,8 @@ function create$2(context) {
153
154
  });
154
155
  }
155
156
  return {
156
- Identifier: visitorFunction,
157
- JSXIdentifier: visitorFunction
157
+ Identifier: visit,
158
+ JSXIdentifier: visit
158
159
  };
159
160
  }
160
161
 
@@ -203,7 +204,7 @@ var is_from_ref_default = createRule({
203
204
  defaultOptions: []
204
205
  });
205
206
  function create$1(context) {
206
- function visitorFunction(node) {
207
+ function visit(node) {
207
208
  const refInit = getRefInitNode(context, node, context.sourceCode.getScope(node));
208
209
  if (refInit != null) {
209
210
  const json = stringify({
@@ -218,8 +219,8 @@ function create$1(context) {
218
219
  }
219
220
  }
220
221
  return {
221
- Identifier: visitorFunction,
222
- JSXIdentifier: visitorFunction
222
+ Identifier: visit,
223
+ JSXIdentifier: visit
223
224
  };
224
225
  }
225
226
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "5.9.5",
3
+ "version": "5.10.1",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -37,22 +37,22 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@typescript-eslint/scope-manager": "^8.62.0",
41
- "@typescript-eslint/types": "^8.62.0",
42
- "@typescript-eslint/utils": "^8.62.0",
40
+ "@typescript-eslint/scope-manager": "^8.62.1",
41
+ "@typescript-eslint/types": "^8.62.1",
42
+ "@typescript-eslint/utils": "^8.62.1",
43
43
  "ts-pattern": "^5.9.0",
44
- "@eslint-react/ast": "5.9.5",
45
- "@eslint-react/core": "5.9.5",
46
- "@eslint-react/jsx": "5.9.5",
47
- "@eslint-react/shared": "5.9.5",
48
- "@eslint-react/eslint": "5.9.5"
44
+ "@eslint-react/ast": "5.10.1",
45
+ "@eslint-react/core": "5.10.1",
46
+ "@eslint-react/eslint": "5.10.1",
47
+ "@eslint-react/jsx": "5.10.1",
48
+ "@eslint-react/shared": "5.10.1",
49
+ "@eslint-react/var": "5.10.1"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@types/react": "^19.2.17",
52
53
  "@types/react-dom": "^19.2.3",
53
- "@typescript-eslint/rule-tester": "^8.62.0",
54
54
  "dedent": "^1.7.2",
55
- "eslint": "^10.5.0",
55
+ "eslint": "^10.6.0",
56
56
  "tsdown": "^0.22.3",
57
57
  "typescript": "6.0.3",
58
58
  "@local/configs": "0.0.0",