eslint-plugin-react-debug 1.41.1-next.0 → 1.41.1-next.2

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
@@ -5,6 +5,7 @@ var ER2 = require('@eslint-react/core');
5
5
  var utils = require('@typescript-eslint/utils');
6
6
  var JSX = require('@eslint-react/jsx');
7
7
  var kit = require('@eslint-react/kit');
8
+ var types = require('@typescript-eslint/types');
8
9
  var tsPattern = require('ts-pattern');
9
10
  var typescript = require('typescript');
10
11
 
@@ -56,7 +57,7 @@ var settings = {
56
57
 
57
58
  // package.json
58
59
  var name2 = "eslint-plugin-react-debug";
59
- var version = "1.41.1-next.0";
60
+ var version = "1.41.1-next.2";
60
61
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
61
62
 
62
63
  // src/rules/class-component.ts
@@ -267,30 +268,26 @@ function create5(context) {
267
268
  ...jsxConfigFromContext,
268
269
  ...jsxConfigFromAnnotation
269
270
  };
270
- const getDescriptor = (type) => ({
271
- messageId: "jsx",
272
- data: {
273
- type,
274
- jsx: tsPattern.match(jsxConfig.jsx).with(typescript.JsxEmit.None, () => "none").with(typescript.JsxEmit.ReactJSX, () => "react-jsx").with(typescript.JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(typescript.JsxEmit.React, () => "react").with(typescript.JsxEmit.ReactNative, () => "react-native").with(typescript.JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
275
- jsxFactory: jsxConfig.jsxFactory,
276
- jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
277
- jsxImportSource: jsxConfig.jsxImportSource,
278
- jsxRuntime: tsPattern.match(jsxConfig.jsx).with(tsPattern.P.union(typescript.JsxEmit.None, typescript.JsxEmit.ReactJSX, typescript.JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
279
- }
280
- });
271
+ function getReportDescriptor(node) {
272
+ return {
273
+ messageId: "jsx",
274
+ node,
275
+ data: {
276
+ type: tsPattern.match(node).with({ type: types.AST_NODE_TYPES.JSXElement }, (n) => JSX__namespace.isFragmentElement(n) ? "fragment" : "element").with({ type: types.AST_NODE_TYPES.JSXFragment }, () => "fragment").exhaustive(),
277
+ jsx: tsPattern.match(jsxConfig.jsx).with(typescript.JsxEmit.None, () => "none").with(typescript.JsxEmit.ReactJSX, () => "react-jsx").with(typescript.JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(typescript.JsxEmit.React, () => "react").with(typescript.JsxEmit.ReactNative, () => "react-native").with(typescript.JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
278
+ jsxFactory: jsxConfig.jsxFactory,
279
+ jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
280
+ jsxImportSource: jsxConfig.jsxImportSource,
281
+ jsxRuntime: tsPattern.match(jsxConfig.jsx).with(tsPattern.P.union(typescript.JsxEmit.None, typescript.JsxEmit.ReactJSX, typescript.JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
282
+ }
283
+ };
284
+ }
281
285
  return {
282
286
  JSXElement(node) {
283
- const isFragment = JSX__namespace.isFragmentElement(node);
284
- context.report({
285
- ...getDescriptor(isFragment ? "fragment" : "element"),
286
- node
287
- });
287
+ context.report(getReportDescriptor(node));
288
288
  },
289
289
  JSXFragment(node) {
290
- context.report({
291
- ...getDescriptor("fragment"),
292
- node
293
- });
290
+ context.report(getReportDescriptor(node));
294
291
  }
295
292
  };
296
293
  }
package/dist/index.mjs CHANGED
@@ -3,6 +3,7 @@ import * as ER2 from '@eslint-react/core';
3
3
  import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
4
4
  import * as JSX from '@eslint-react/jsx';
5
5
  import { JsxConfig } from '@eslint-react/kit';
6
+ import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from '@typescript-eslint/types';
6
7
  import { match, P } from 'ts-pattern';
7
8
  import { JsxEmit } from 'typescript';
8
9
 
@@ -33,7 +34,7 @@ var settings = {
33
34
 
34
35
  // package.json
35
36
  var name2 = "eslint-plugin-react-debug";
36
- var version = "1.41.1-next.0";
37
+ var version = "1.41.1-next.2";
37
38
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
38
39
 
39
40
  // src/rules/class-component.ts
@@ -244,30 +245,26 @@ function create5(context) {
244
245
  ...jsxConfigFromContext,
245
246
  ...jsxConfigFromAnnotation
246
247
  };
247
- const getDescriptor = (type) => ({
248
- messageId: "jsx",
249
- data: {
250
- type,
251
- jsx: match(jsxConfig.jsx).with(JsxEmit.None, () => "none").with(JsxEmit.ReactJSX, () => "react-jsx").with(JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(JsxEmit.React, () => "react").with(JsxEmit.ReactNative, () => "react-native").with(JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
252
- jsxFactory: jsxConfig.jsxFactory,
253
- jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
254
- jsxImportSource: jsxConfig.jsxImportSource,
255
- jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
256
- }
257
- });
248
+ function getReportDescriptor(node) {
249
+ return {
250
+ messageId: "jsx",
251
+ node,
252
+ data: {
253
+ type: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => JSX.isFragmentElement(n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
254
+ jsx: match(jsxConfig.jsx).with(JsxEmit.None, () => "none").with(JsxEmit.ReactJSX, () => "react-jsx").with(JsxEmit.ReactJSXDev, () => "react-jsx-dev").with(JsxEmit.React, () => "react").with(JsxEmit.ReactNative, () => "react-native").with(JsxEmit.Preserve, () => "preserve").otherwise(() => "unknown"),
255
+ jsxFactory: jsxConfig.jsxFactory,
256
+ jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
257
+ jsxImportSource: jsxConfig.jsxImportSource,
258
+ jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
259
+ }
260
+ };
261
+ }
258
262
  return {
259
263
  JSXElement(node) {
260
- const isFragment = JSX.isFragmentElement(node);
261
- context.report({
262
- ...getDescriptor(isFragment ? "fragment" : "element"),
263
- node
264
- });
264
+ context.report(getReportDescriptor(node));
265
265
  },
266
266
  JSXFragment(node) {
267
- context.report({
268
- ...getDescriptor("fragment"),
269
- node
270
- });
267
+ context.report(getReportDescriptor(node));
271
268
  }
272
269
  };
273
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "1.41.1-next.0",
3
+ "version": "1.41.1-next.2",
4
4
  "description": "ESLint React's ESLint plugin for debugging related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -49,13 +49,13 @@
49
49
  "@typescript-eslint/utils": "^8.29.1",
50
50
  "string-ts": "^2.2.1",
51
51
  "ts-pattern": "^5.7.0",
52
- "@eslint-react/ast": "1.41.1-next.0",
53
- "@eslint-react/kit": "1.41.1-next.0",
54
- "@eslint-react/core": "1.41.1-next.0",
55
- "@eslint-react/eff": "1.41.1-next.0",
56
- "@eslint-react/jsx": "1.41.1-next.0",
57
- "@eslint-react/shared": "1.41.1-next.0",
58
- "@eslint-react/var": "1.41.1-next.0"
52
+ "@eslint-react/core": "1.41.1-next.2",
53
+ "@eslint-react/kit": "1.41.1-next.2",
54
+ "@eslint-react/eff": "1.41.1-next.2",
55
+ "@eslint-react/jsx": "1.41.1-next.2",
56
+ "@eslint-react/var": "1.41.1-next.2",
57
+ "@eslint-react/shared": "1.41.1-next.2",
58
+ "@eslint-react/ast": "1.41.1-next.2"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^19.1.0",