eslint-plugin-react-debug 1.47.1-next.0 → 1.47.1
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 +13 -7
- package/dist/index.mjs +13 -7
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -56,9 +56,14 @@ var settings = {
|
|
|
56
56
|
|
|
57
57
|
// package.json
|
|
58
58
|
var name2 = "eslint-plugin-react-debug";
|
|
59
|
-
var version = "1.47.1
|
|
59
|
+
var version = "1.47.1";
|
|
60
60
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
|
|
61
61
|
|
|
62
|
+
// src/utils/stringify.ts
|
|
63
|
+
function stringify(value) {
|
|
64
|
+
return JSON.stringify(value, null, 2);
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
// src/rules/class-component.ts
|
|
63
68
|
var RULE_NAME = "class-component";
|
|
64
69
|
var RULE_FEATURES = [
|
|
@@ -91,7 +96,7 @@ function create(context) {
|
|
|
91
96
|
messageId: "classComponent",
|
|
92
97
|
node: component,
|
|
93
98
|
data: {
|
|
94
|
-
json:
|
|
99
|
+
json: stringify({ name: name3 })
|
|
95
100
|
}
|
|
96
101
|
});
|
|
97
102
|
}
|
|
@@ -137,7 +142,7 @@ function create2(context) {
|
|
|
137
142
|
messageId: "functionComponent",
|
|
138
143
|
node,
|
|
139
144
|
data: {
|
|
140
|
-
json:
|
|
145
|
+
json: stringify({
|
|
141
146
|
name: name3,
|
|
142
147
|
displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
|
|
143
148
|
forwardRef: (flag & ER2__namespace.ComponentFlag.ForwardRef) > 0n,
|
|
@@ -181,7 +186,7 @@ function create3(context) {
|
|
|
181
186
|
messageId: "hook",
|
|
182
187
|
node,
|
|
183
188
|
data: {
|
|
184
|
-
json:
|
|
189
|
+
json: stringify({
|
|
185
190
|
name: name3,
|
|
186
191
|
hookCalls: hookCalls.length
|
|
187
192
|
})
|
|
@@ -234,7 +239,7 @@ function create4(context) {
|
|
|
234
239
|
messageId: "isFromReact",
|
|
235
240
|
node,
|
|
236
241
|
data: {
|
|
237
|
-
json:
|
|
242
|
+
json: stringify({
|
|
238
243
|
name: name3,
|
|
239
244
|
importSource
|
|
240
245
|
})
|
|
@@ -278,8 +283,9 @@ function create5(context) {
|
|
|
278
283
|
messageId: "jsx",
|
|
279
284
|
node,
|
|
280
285
|
data: {
|
|
281
|
-
json:
|
|
282
|
-
|
|
286
|
+
json: stringify({
|
|
287
|
+
kind: 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(),
|
|
288
|
+
type: ER2__namespace.getElementType(context2, node),
|
|
283
289
|
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"),
|
|
284
290
|
jsxFactory: jsxConfig.jsxFactory,
|
|
285
291
|
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
package/dist/index.mjs
CHANGED
|
@@ -34,9 +34,14 @@ var settings = {
|
|
|
34
34
|
|
|
35
35
|
// package.json
|
|
36
36
|
var name2 = "eslint-plugin-react-debug";
|
|
37
|
-
var version = "1.47.1
|
|
37
|
+
var version = "1.47.1";
|
|
38
38
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
|
|
39
39
|
|
|
40
|
+
// src/utils/stringify.ts
|
|
41
|
+
function stringify(value) {
|
|
42
|
+
return JSON.stringify(value, null, 2);
|
|
43
|
+
}
|
|
44
|
+
|
|
40
45
|
// src/rules/class-component.ts
|
|
41
46
|
var RULE_NAME = "class-component";
|
|
42
47
|
var RULE_FEATURES = [
|
|
@@ -69,7 +74,7 @@ function create(context) {
|
|
|
69
74
|
messageId: "classComponent",
|
|
70
75
|
node: component,
|
|
71
76
|
data: {
|
|
72
|
-
json:
|
|
77
|
+
json: stringify({ name: name3 })
|
|
73
78
|
}
|
|
74
79
|
});
|
|
75
80
|
}
|
|
@@ -115,7 +120,7 @@ function create2(context) {
|
|
|
115
120
|
messageId: "functionComponent",
|
|
116
121
|
node,
|
|
117
122
|
data: {
|
|
118
|
-
json:
|
|
123
|
+
json: stringify({
|
|
119
124
|
name: name3,
|
|
120
125
|
displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
|
|
121
126
|
forwardRef: (flag & ER2.ComponentFlag.ForwardRef) > 0n,
|
|
@@ -159,7 +164,7 @@ function create3(context) {
|
|
|
159
164
|
messageId: "hook",
|
|
160
165
|
node,
|
|
161
166
|
data: {
|
|
162
|
-
json:
|
|
167
|
+
json: stringify({
|
|
163
168
|
name: name3,
|
|
164
169
|
hookCalls: hookCalls.length
|
|
165
170
|
})
|
|
@@ -212,7 +217,7 @@ function create4(context) {
|
|
|
212
217
|
messageId: "isFromReact",
|
|
213
218
|
node,
|
|
214
219
|
data: {
|
|
215
|
-
json:
|
|
220
|
+
json: stringify({
|
|
216
221
|
name: name3,
|
|
217
222
|
importSource
|
|
218
223
|
})
|
|
@@ -256,8 +261,9 @@ function create5(context) {
|
|
|
256
261
|
messageId: "jsx",
|
|
257
262
|
node,
|
|
258
263
|
data: {
|
|
259
|
-
json:
|
|
260
|
-
|
|
264
|
+
json: stringify({
|
|
265
|
+
kind: 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(),
|
|
266
|
+
type: ER2.getElementType(context2, node),
|
|
261
267
|
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"),
|
|
262
268
|
jsxFactory: jsxConfig.jsxFactory,
|
|
263
269
|
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "1.47.1
|
|
3
|
+
"version": "1.47.1",
|
|
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.29.1",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.7.0",
|
|
52
|
-
"@eslint-react/ast": "1.47.1
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/kit": "1.47.1
|
|
56
|
-
"@eslint-react/shared": "1.47.1
|
|
57
|
-
"@eslint-react/var": "1.47.1
|
|
52
|
+
"@eslint-react/ast": "1.47.1",
|
|
53
|
+
"@eslint-react/core": "1.47.1",
|
|
54
|
+
"@eslint-react/eff": "1.47.1",
|
|
55
|
+
"@eslint-react/kit": "1.47.1",
|
|
56
|
+
"@eslint-react/shared": "1.47.1",
|
|
57
|
+
"@eslint-react/var": "1.47.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/react": "^19.1.1",
|