eslint-plugin-react-debug 1.46.1-next.0 → 1.47.0-beta.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 +6 -8
- package/dist/index.mjs +6 -7
- package/package.json +7 -8
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ var shared = require('@eslint-react/shared');
|
|
|
4
4
|
var ER2 = require('@eslint-react/core');
|
|
5
5
|
var utils = require('@typescript-eslint/utils');
|
|
6
6
|
var eff = require('@eslint-react/eff');
|
|
7
|
-
var JSX = require('@eslint-react/jsx');
|
|
8
7
|
var kit = require('@eslint-react/kit');
|
|
9
8
|
var types = require('@typescript-eslint/types');
|
|
10
9
|
var tsPattern = require('ts-pattern');
|
|
@@ -29,7 +28,6 @@ function _interopNamespace(e) {
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
var ER2__namespace = /*#__PURE__*/_interopNamespace(ER2);
|
|
32
|
-
var JSX__namespace = /*#__PURE__*/_interopNamespace(JSX);
|
|
33
31
|
|
|
34
32
|
var __defProp = Object.defineProperty;
|
|
35
33
|
var __export = (target, all) => {
|
|
@@ -58,7 +56,7 @@ var settings = {
|
|
|
58
56
|
|
|
59
57
|
// package.json
|
|
60
58
|
var name2 = "eslint-plugin-react-debug";
|
|
61
|
-
var version = "1.
|
|
59
|
+
var version = "1.47.0-beta.2";
|
|
62
60
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
|
|
63
61
|
|
|
64
62
|
// src/rules/class-component.ts
|
|
@@ -275,13 +273,13 @@ function create5(context) {
|
|
|
275
273
|
...jsxConfigFromContext,
|
|
276
274
|
...jsxConfigFromAnnotation
|
|
277
275
|
};
|
|
278
|
-
function getReportDescriptor(
|
|
279
|
-
return {
|
|
276
|
+
function getReportDescriptor(context2) {
|
|
277
|
+
return (node) => ({
|
|
280
278
|
messageId: "jsx",
|
|
281
279
|
node,
|
|
282
280
|
data: {
|
|
283
281
|
json: JSON.stringify({
|
|
284
|
-
type: tsPattern.match(node).with({ type: types.AST_NODE_TYPES.JSXElement }, (n) =>
|
|
282
|
+
type: tsPattern.match(node).with({ type: types.AST_NODE_TYPES.JSXElement }, (n) => ER2__namespace.isFragmentElement(context2, n) ? "fragment" : "element").with({ type: types.AST_NODE_TYPES.JSXFragment }, () => "fragment").exhaustive(),
|
|
285
283
|
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"),
|
|
286
284
|
jsxFactory: jsxConfig.jsxFactory,
|
|
287
285
|
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
|
@@ -289,10 +287,10 @@ function create5(context) {
|
|
|
289
287
|
jsxRuntime: tsPattern.match(jsxConfig.jsx).with(tsPattern.P.union(typescript.JsxEmit.None, typescript.JsxEmit.ReactJSX, typescript.JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
|
|
290
288
|
})
|
|
291
289
|
}
|
|
292
|
-
};
|
|
290
|
+
});
|
|
293
291
|
}
|
|
294
292
|
return {
|
|
295
|
-
"JSXElement, JSXFragment": eff.flow(getReportDescriptor, kit.Report.make(context).send)
|
|
293
|
+
"JSXElement, JSXFragment": eff.flow(getReportDescriptor(context), kit.Report.make(context).send)
|
|
296
294
|
};
|
|
297
295
|
}
|
|
298
296
|
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,6 @@ import { getDocsUrl, getSettingsFromContext, DEFAULT_ESLINT_REACT_SETTINGS } fro
|
|
|
2
2
|
import * as ER2 from '@eslint-react/core';
|
|
3
3
|
import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
4
4
|
import { flow } from '@eslint-react/eff';
|
|
5
|
-
import * as JSX from '@eslint-react/jsx';
|
|
6
5
|
import { JsxConfig, Report } from '@eslint-react/kit';
|
|
7
6
|
import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from '@typescript-eslint/types';
|
|
8
7
|
import { match, P } from 'ts-pattern';
|
|
@@ -35,7 +34,7 @@ var settings = {
|
|
|
35
34
|
|
|
36
35
|
// package.json
|
|
37
36
|
var name2 = "eslint-plugin-react-debug";
|
|
38
|
-
var version = "1.
|
|
37
|
+
var version = "1.47.0-beta.2";
|
|
39
38
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
|
|
40
39
|
|
|
41
40
|
// src/rules/class-component.ts
|
|
@@ -252,13 +251,13 @@ function create5(context) {
|
|
|
252
251
|
...jsxConfigFromContext,
|
|
253
252
|
...jsxConfigFromAnnotation
|
|
254
253
|
};
|
|
255
|
-
function getReportDescriptor(
|
|
256
|
-
return {
|
|
254
|
+
function getReportDescriptor(context2) {
|
|
255
|
+
return (node) => ({
|
|
257
256
|
messageId: "jsx",
|
|
258
257
|
node,
|
|
259
258
|
data: {
|
|
260
259
|
json: JSON.stringify({
|
|
261
|
-
type: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) =>
|
|
260
|
+
type: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => ER2.isFragmentElement(context2, n) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
|
|
262
261
|
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"),
|
|
263
262
|
jsxFactory: jsxConfig.jsxFactory,
|
|
264
263
|
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
|
@@ -266,10 +265,10 @@ function create5(context) {
|
|
|
266
265
|
jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
|
|
267
266
|
})
|
|
268
267
|
}
|
|
269
|
-
};
|
|
268
|
+
});
|
|
270
269
|
}
|
|
271
270
|
return {
|
|
272
|
-
"JSXElement, JSXFragment": flow(getReportDescriptor, Report.make(context).send)
|
|
271
|
+
"JSXElement, JSXFragment": flow(getReportDescriptor(context), Report.make(context).send)
|
|
273
272
|
};
|
|
274
273
|
}
|
|
275
274
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0-beta.2",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for debugging related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,13 +49,12 @@
|
|
|
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.
|
|
53
|
-
"@eslint-react/core": "1.
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/var": "1.
|
|
58
|
-
"@eslint-react/jsx": "1.46.1-next.0"
|
|
52
|
+
"@eslint-react/ast": "1.47.0-beta.2",
|
|
53
|
+
"@eslint-react/core": "1.47.0-beta.2",
|
|
54
|
+
"@eslint-react/kit": "1.47.0-beta.2",
|
|
55
|
+
"@eslint-react/shared": "1.47.0-beta.2",
|
|
56
|
+
"@eslint-react/eff": "1.47.0-beta.2",
|
|
57
|
+
"@eslint-react/var": "1.47.0-beta.2"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@types/react": "^19.1.1",
|