eslint-plugin-react-debug 5.24.3 → 5.24.4

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 +13 -49
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -10,44 +10,32 @@ import { findVariable } from "@typescript-eslint/utils/ast-utils";
10
10
  import { getElementFullType, isFragmentElement } from "@eslint-react/jsx";
11
11
  import { P, match } from "ts-pattern";
12
12
  import ts from "typescript";
13
-
14
13
  //#region \0rolldown/runtime.js
15
14
  var __defProp = Object.defineProperty;
16
15
  var __exportAll = (all, no_symbols) => {
17
16
  let target = {};
18
- for (var name in all) {
19
- __defProp(target, name, {
20
- get: all[name],
21
- enumerable: true
22
- });
23
- }
24
- if (!no_symbols) {
25
- __defProp(target, Symbol.toStringTag, { value: "Module" });
26
- }
17
+ for (var name in all) __defProp(target, name, {
18
+ get: all[name],
19
+ enumerable: true
20
+ });
21
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
27
22
  return target;
28
23
  };
29
-
30
24
  //#endregion
31
25
  //#region package.json
32
26
  var name$1 = "eslint-plugin-react-debug";
33
- var version = "5.24.3";
34
-
27
+ var version = "5.24.4";
35
28
  //#endregion
36
29
  //#region src/utils/create-rule.ts
37
30
  function getDocsUrl(ruleName) {
38
31
  return `https://eslint-react.xyz/docs/rules/debug-${ruleName}`;
39
32
  }
40
33
  const createRule = ESLintUtils.RuleCreator(getDocsUrl);
41
-
42
34
  //#endregion
43
35
  //#region src/utils/stringify.ts
44
36
  function stringify(value) {
45
37
  return JSON.stringify(value, null, 2);
46
38
  }
47
-
48
- //#endregion
49
- //#region src/rules/function-component/function-component.ts
50
- const RULE_NAME$4 = "function-component";
51
39
  var function_component_default = createRule({
52
40
  meta: {
53
41
  type: "problem",
@@ -55,7 +43,7 @@ var function_component_default = createRule({
55
43
  messages: { default: "{{json}}" },
56
44
  schema: []
57
45
  },
58
- name: RULE_NAME$4,
46
+ name: "function-component",
59
47
  create: create$4,
60
48
  defaultOptions: []
61
49
  });
@@ -78,10 +66,6 @@ function create$4(context) {
78
66
  });
79
67
  } });
80
68
  }
81
-
82
- //#endregion
83
- //#region src/rules/hook/hook.ts
84
- const RULE_NAME$3 = "hook";
85
69
  var hook_default = createRule({
86
70
  meta: {
87
71
  type: "problem",
@@ -89,7 +73,7 @@ var hook_default = createRule({
89
73
  messages: { default: "{{json}}" },
90
74
  schema: []
91
75
  },
92
- name: RULE_NAME$3,
76
+ name: "hook",
93
77
  create: create$3,
94
78
  defaultOptions: []
95
79
  });
@@ -106,7 +90,6 @@ function create$3(context) {
106
90
  });
107
91
  } });
108
92
  }
109
-
110
93
  //#endregion
111
94
  //#region src/rules/is-from-react/lib.ts
112
95
  function isFromReact(node, initialScope, importSource = "react") {
@@ -117,10 +100,6 @@ function isFromReact(node, initialScope, importSource = "react") {
117
100
  default: return isInitializedFromReact(name, initialScope, importSource);
118
101
  }
119
102
  }
120
-
121
- //#endregion
122
- //#region src/rules/is-from-react/is-from-react.ts
123
- const RULE_NAME$2 = "is-from-react";
124
103
  var is_from_react_default = createRule({
125
104
  meta: {
126
105
  type: "problem",
@@ -128,7 +107,7 @@ var is_from_react_default = createRule({
128
107
  messages: { default: "{{json}}" },
129
108
  schema: []
130
109
  },
131
- name: RULE_NAME$2,
110
+ name: "is-from-react",
132
111
  create: create$2,
133
112
  defaultOptions: []
134
113
  });
@@ -137,8 +116,7 @@ function create$2(context) {
137
116
  function visit(node) {
138
117
  if (node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name) return;
139
118
  const name = node.name;
140
- const initialScope = context.sourceCode.getScope(node);
141
- if (!isFromReact(node, initialScope, importSource)) return;
119
+ if (!isFromReact(node, context.sourceCode.getScope(node), importSource)) return;
142
120
  context.report({
143
121
  data: { json: stringify({
144
122
  name,
@@ -153,7 +131,6 @@ function create$2(context) {
153
131
  JSXIdentifier: visit
154
132
  };
155
133
  }
156
-
157
134
  //#endregion
158
135
  //#region src/rules/is-from-ref/lib.ts
159
136
  function getRefInitNode(context, node, initialScope) {
@@ -177,10 +154,6 @@ function getRefInit(context, name, initialScope) {
177
154
  }
178
155
  return null;
179
156
  }
180
-
181
- //#endregion
182
- //#region src/rules/is-from-ref/is-from-ref.ts
183
- const RULE_NAME$1 = "is-from-ref";
184
157
  var is_from_ref_default = createRule({
185
158
  meta: {
186
159
  type: "problem",
@@ -188,14 +161,13 @@ var is_from_ref_default = createRule({
188
161
  messages: { default: "{{json}}" },
189
162
  schema: []
190
163
  },
191
- name: RULE_NAME$1,
164
+ name: "is-from-ref",
192
165
  create: create$1,
193
166
  defaultOptions: []
194
167
  });
195
168
  function create$1(context) {
196
169
  function visit(node) {
197
- const initialScope = context.sourceCode.getScope(node);
198
- const refInit = getRefInitNode(context, node, initialScope);
170
+ const refInit = getRefInitNode(context, node, context.sourceCode.getScope(node));
199
171
  if (refInit == null) return;
200
172
  context.report({
201
173
  data: { json: stringify({
@@ -211,10 +183,6 @@ function create$1(context) {
211
183
  JSXIdentifier: visit
212
184
  };
213
185
  }
214
-
215
- //#endregion
216
- //#region src/rules/jsx/jsx.ts
217
- const RULE_NAME = "jsx";
218
186
  var jsx_default = createRule({
219
187
  meta: {
220
188
  type: "problem",
@@ -248,7 +216,6 @@ function create(context) {
248
216
  JSXFragment: visit
249
217
  };
250
218
  }
251
-
252
219
  //#endregion
253
220
  //#region src/plugin.ts
254
221
  const plugin = {
@@ -264,7 +231,6 @@ const plugin = {
264
231
  ["jsx"]: jsx_default
265
232
  }
266
233
  };
267
-
268
234
  //#endregion
269
235
  //#region src/configs/all.ts
270
236
  var all_exports = /* @__PURE__ */ __exportAll({
@@ -283,7 +249,6 @@ const rules = {
283
249
  };
284
250
  const plugins = { "react-debug": plugin };
285
251
  const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
286
-
287
252
  //#endregion
288
253
  //#region src/index.ts
289
254
  function createConfig(base) {
@@ -301,6 +266,5 @@ const finalPlugin = {
301
266
  ...plugin,
302
267
  configs: { ["all"]: createConfig(all_exports) }
303
268
  };
304
-
305
269
  //#endregion
306
- export { finalPlugin as default };
270
+ export { finalPlugin as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "5.24.3",
3
+ "version": "5.24.4",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -37,12 +37,12 @@
37
37
  "dist"
38
38
  ],
39
39
  "dependencies": {
40
- "@eslint-react/ast": "5.24.3",
41
- "@eslint-react/core": "5.24.3",
42
- "@eslint-react/eslint": "5.24.3",
43
- "@eslint-react/jsx": "5.24.3",
44
- "@eslint-react/shared": "5.24.3",
45
- "@eslint-react/var": "5.24.3",
40
+ "@eslint-react/ast": "5.24.4",
41
+ "@eslint-react/core": "5.24.4",
42
+ "@eslint-react/eslint": "5.24.4",
43
+ "@eslint-react/jsx": "5.24.4",
44
+ "@eslint-react/shared": "5.24.4",
45
+ "@eslint-react/var": "5.24.4",
46
46
  "@typescript-eslint/scope-manager": "^8.71.0",
47
47
  "@typescript-eslint/types": "^8.71.0",
48
48
  "@typescript-eslint/utils": "^8.71.0",