eslint-plugin-react-debug 1.52.4 → 1.52.5-next.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.
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ var settings = {
55
55
 
56
56
  // package.json
57
57
  var name2 = "eslint-plugin-react-debug";
58
- var version = "1.52.4";
58
+ var version = "1.52.5-next.0";
59
59
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
60
60
 
61
61
  // src/utils/stringify.ts
@@ -217,23 +217,12 @@ var is_from_react_default = createRule({
217
217
  });
218
218
  function create4(context) {
219
219
  const { importSource = "react" } = shared.getSettingsFromContext(context);
220
- function isFromReact(node, initialScope) {
221
- const name3 = node.name;
222
- switch (true) {
223
- case (node.parent.type === utils.AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.Identifier):
224
- return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
225
- case (node.parent.type === utils.AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.JSXIdentifier):
226
- return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
227
- default:
228
- return ER2__namespace.isInitializedFromReact(name3, importSource, initialScope);
229
- }
230
- }
231
220
  function visitorFunction(node) {
232
221
  const shouldSkipDuplicate = node.parent.type === utils.AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name;
233
222
  if (shouldSkipDuplicate) return;
234
223
  const name3 = node.name;
235
224
  const initialScope = context.sourceCode.getScope(node);
236
- if (!isFromReact(node, initialScope)) return;
225
+ if (!isFromReact(node, importSource, initialScope)) return;
237
226
  context.report({
238
227
  messageId: "isFromReact",
239
228
  node,
@@ -250,6 +239,17 @@ function create4(context) {
250
239
  JSXIdentifier: visitorFunction
251
240
  };
252
241
  }
242
+ function isFromReact(node, importSource, initialScope) {
243
+ const name3 = node.name;
244
+ switch (true) {
245
+ case (node.parent.type === utils.AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.Identifier):
246
+ return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
247
+ case (node.parent.type === utils.AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.JSXIdentifier):
248
+ return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
249
+ default:
250
+ return ER2__namespace.isInitializedFromReact(name3, importSource, initialScope);
251
+ }
252
+ }
253
253
  var { JsxEmit } = kit.JsxConfig;
254
254
  var RULE_NAME5 = "jsx";
255
255
  var RULE_FEATURES5 = [
package/dist/index.mjs CHANGED
@@ -33,7 +33,7 @@ var settings = {
33
33
 
34
34
  // package.json
35
35
  var name2 = "eslint-plugin-react-debug";
36
- var version = "1.52.4";
36
+ var version = "1.52.5-next.0";
37
37
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
38
38
 
39
39
  // src/utils/stringify.ts
@@ -195,23 +195,12 @@ var is_from_react_default = createRule({
195
195
  });
196
196
  function create4(context) {
197
197
  const { importSource = "react" } = getSettingsFromContext(context);
198
- function isFromReact(node, initialScope) {
199
- const name3 = node.name;
200
- switch (true) {
201
- case (node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier):
202
- return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
203
- case (node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier):
204
- return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
205
- default:
206
- return ER2.isInitializedFromReact(name3, importSource, initialScope);
207
- }
208
- }
209
198
  function visitorFunction(node) {
210
199
  const shouldSkipDuplicate = node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name;
211
200
  if (shouldSkipDuplicate) return;
212
201
  const name3 = node.name;
213
202
  const initialScope = context.sourceCode.getScope(node);
214
- if (!isFromReact(node, initialScope)) return;
203
+ if (!isFromReact(node, importSource, initialScope)) return;
215
204
  context.report({
216
205
  messageId: "isFromReact",
217
206
  node,
@@ -228,6 +217,17 @@ function create4(context) {
228
217
  JSXIdentifier: visitorFunction
229
218
  };
230
219
  }
220
+ function isFromReact(node, importSource, initialScope) {
221
+ const name3 = node.name;
222
+ switch (true) {
223
+ case (node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier):
224
+ return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
225
+ case (node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier):
226
+ return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
227
+ default:
228
+ return ER2.isInitializedFromReact(name3, importSource, initialScope);
229
+ }
230
+ }
231
231
  var { JsxEmit } = JsxConfig;
232
232
  var RULE_NAME5 = "jsx";
233
233
  var RULE_FEATURES5 = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "1.52.4",
3
+ "version": "1.52.5-next.0",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -49,12 +49,12 @@
49
49
  "@typescript-eslint/utils": "^8.39.1",
50
50
  "string-ts": "^2.2.1",
51
51
  "ts-pattern": "^5.8.0",
52
- "@eslint-react/ast": "1.52.4",
53
- "@eslint-react/eff": "1.52.4",
54
- "@eslint-react/shared": "1.52.4",
55
- "@eslint-react/kit": "1.52.4",
56
- "@eslint-react/var": "1.52.4",
57
- "@eslint-react/core": "1.52.4"
52
+ "@eslint-react/ast": "1.52.5-next.0",
53
+ "@eslint-react/core": "1.52.5-next.0",
54
+ "@eslint-react/eff": "1.52.5-next.0",
55
+ "@eslint-react/shared": "1.52.5-next.0",
56
+ "@eslint-react/kit": "1.52.5-next.0",
57
+ "@eslint-react/var": "1.52.5-next.0"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/react": "^19.1.10",