eslint-plugin-react-debug 1.41.1-beta.2 → 1.41.1-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
@@ -5,7 +5,6 @@ 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');
9
8
  var tsPattern = require('ts-pattern');
10
9
  var typescript = require('typescript');
11
10
 
@@ -57,7 +56,7 @@ var settings = {
57
56
 
58
57
  // package.json
59
58
  var name2 = "eslint-plugin-react-debug";
60
- var version = "1.41.1-beta.2";
59
+ var version = "1.41.1-next.0";
61
60
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
62
61
 
63
62
  // src/rules/class-component.ts
@@ -268,26 +267,30 @@ function create5(context) {
268
267
  ...jsxConfigFromContext,
269
268
  ...jsxConfigFromAnnotation
270
269
  };
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
- }
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
+ });
285
281
  return {
286
282
  JSXElement(node) {
287
- context.report(getReportDescriptor(node));
283
+ const isFragment = JSX__namespace.isFragmentElement(node);
284
+ context.report({
285
+ ...getDescriptor(isFragment ? "fragment" : "element"),
286
+ node
287
+ });
288
288
  },
289
289
  JSXFragment(node) {
290
- context.report(getReportDescriptor(node));
290
+ context.report({
291
+ ...getDescriptor("fragment"),
292
+ node
293
+ });
291
294
  }
292
295
  };
293
296
  }
package/dist/index.mjs CHANGED
@@ -3,7 +3,6 @@ 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';
7
6
  import { match, P } from 'ts-pattern';
8
7
  import { JsxEmit } from 'typescript';
9
8
 
@@ -34,7 +33,7 @@ var settings = {
34
33
 
35
34
  // package.json
36
35
  var name2 = "eslint-plugin-react-debug";
37
- var version = "1.41.1-beta.2";
36
+ var version = "1.41.1-next.0";
38
37
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
39
38
 
40
39
  // src/rules/class-component.ts
@@ -245,26 +244,30 @@ function create5(context) {
245
244
  ...jsxConfigFromContext,
246
245
  ...jsxConfigFromAnnotation
247
246
  };
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
- }
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
+ });
262
258
  return {
263
259
  JSXElement(node) {
264
- context.report(getReportDescriptor(node));
260
+ const isFragment = JSX.isFragmentElement(node);
261
+ context.report({
262
+ ...getDescriptor(isFragment ? "fragment" : "element"),
263
+ node
264
+ });
265
265
  },
266
266
  JSXFragment(node) {
267
- context.report(getReportDescriptor(node));
267
+ context.report({
268
+ ...getDescriptor("fragment"),
269
+ node
270
+ });
268
271
  }
269
272
  };
270
273
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-debug",
3
- "version": "1.41.1-beta.2",
3
+ "version": "1.41.1-next.0",
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-beta.2",
53
- "@eslint-react/core": "1.41.1-beta.2",
54
- "@eslint-react/jsx": "1.41.1-beta.2",
55
- "@eslint-react/shared": "1.41.1-beta.2",
56
- "@eslint-react/var": "1.41.1-beta.2",
57
- "@eslint-react/kit": "1.41.1-beta.2",
58
- "@eslint-react/eff": "1.41.1-beta.2"
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"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^19.1.0",