eslint-plugin-react-debug 3.0.0-next.57 → 3.0.0-next.59
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 +19 -19
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region package.json
|
|
26
26
|
var name$1 = "eslint-plugin-react-debug";
|
|
27
|
-
var version = "3.0.0-next.
|
|
27
|
+
var version = "3.0.0-next.59";
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/utils/create-rule.ts
|
|
@@ -57,9 +57,9 @@ function create$5(context) {
|
|
|
57
57
|
const { ctx, visitor } = core.useComponentCollectorLegacy(context);
|
|
58
58
|
return defineRuleListener(visitor, { "Program:exit"(program) {
|
|
59
59
|
for (const { name = "anonymous", node: component } of ctx.getAllComponents(program)) context.report({
|
|
60
|
+
data: { json: stringify({ name }) },
|
|
60
61
|
messageId: "default",
|
|
61
|
-
node: component
|
|
62
|
-
data: { json: stringify({ name }) }
|
|
62
|
+
node: component
|
|
63
63
|
});
|
|
64
64
|
} });
|
|
65
65
|
}
|
|
@@ -84,16 +84,16 @@ function create$4(context) {
|
|
|
84
84
|
hint: core.DEFAULT_COMPONENT_DETECTION_HINT
|
|
85
85
|
});
|
|
86
86
|
return defineRuleListener(visitor, { "Program:exit"(program) {
|
|
87
|
-
for (const { name = "anonymous",
|
|
88
|
-
messageId: "default",
|
|
89
|
-
node,
|
|
87
|
+
for (const { name = "anonymous", displayName, flag, hookCalls, node } of ctx.getAllComponents(program)) context.report({
|
|
90
88
|
data: { json: stringify({
|
|
91
89
|
name,
|
|
92
90
|
displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
|
|
93
91
|
forwardRef: (flag & core.ComponentFlag.ForwardRef) > 0n,
|
|
94
92
|
hookCalls: hookCalls.length,
|
|
95
93
|
memo: (flag & core.ComponentFlag.Memo) > 0n
|
|
96
|
-
}) }
|
|
94
|
+
}) },
|
|
95
|
+
messageId: "default",
|
|
96
|
+
node
|
|
97
97
|
});
|
|
98
98
|
} });
|
|
99
99
|
}
|
|
@@ -115,13 +115,13 @@ var hook_default = createRule({
|
|
|
115
115
|
function create$3(context) {
|
|
116
116
|
const { ctx, visitor } = core.useHookCollector(context);
|
|
117
117
|
return defineRuleListener(visitor, { "Program:exit"(program) {
|
|
118
|
-
for (const { name,
|
|
119
|
-
messageId: "default",
|
|
120
|
-
node,
|
|
118
|
+
for (const { name, hookCalls, node } of ctx.getAllHooks(program)) context.report({
|
|
121
119
|
data: { json: stringify({
|
|
122
120
|
name,
|
|
123
121
|
hookCalls: hookCalls.length
|
|
124
|
-
}) }
|
|
122
|
+
}) },
|
|
123
|
+
messageId: "default",
|
|
124
|
+
node
|
|
125
125
|
});
|
|
126
126
|
} });
|
|
127
127
|
}
|
|
@@ -147,12 +147,12 @@ function create$2(context) {
|
|
|
147
147
|
const name = node.name;
|
|
148
148
|
if (!isFromReact(node, context.sourceCode.getScope(node), importSource)) return;
|
|
149
149
|
context.report({
|
|
150
|
-
messageId: "default",
|
|
151
|
-
node,
|
|
152
150
|
data: { json: stringify({
|
|
153
151
|
name,
|
|
154
152
|
importSource
|
|
155
|
-
}) }
|
|
153
|
+
}) },
|
|
154
|
+
messageId: "default",
|
|
155
|
+
node
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
return defineRuleListener({
|
|
@@ -199,9 +199,9 @@ function create$1(context) {
|
|
|
199
199
|
init: context.sourceCode.getText(refInit)
|
|
200
200
|
});
|
|
201
201
|
context.report({
|
|
202
|
+
data: { json },
|
|
202
203
|
messageId: "default",
|
|
203
|
-
node
|
|
204
|
-
data: { json }
|
|
204
|
+
node
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -243,8 +243,6 @@ function create(context) {
|
|
|
243
243
|
};
|
|
244
244
|
function getReportDescriptor(context) {
|
|
245
245
|
return (node) => ({
|
|
246
|
-
messageId: "default",
|
|
247
|
-
node,
|
|
248
246
|
data: { json: stringify({
|
|
249
247
|
kind: match(node).with({ type: AST_NODE_TYPES$1.JSXElement }, (n) => core.isJsxFragmentElement(context, n, jsxConfig) ? "fragment" : "element").with({ type: AST_NODE_TYPES$1.JSXFragment }, () => "fragment").exhaustive(),
|
|
250
248
|
type: core.getJsxElementType(context, node),
|
|
@@ -253,7 +251,9 @@ function create(context) {
|
|
|
253
251
|
jsxFragmentFactory: jsxConfig.jsxFragmentFactory,
|
|
254
252
|
jsxImportSource: jsxConfig.jsxImportSource,
|
|
255
253
|
jsxRuntime: match(jsxConfig.jsx).with(P.union(JsxEmit.None, JsxEmit.ReactJSX, JsxEmit.ReactJSXDev), () => "automatic").otherwise(() => "classic")
|
|
256
|
-
}) }
|
|
254
|
+
}) },
|
|
255
|
+
messageId: "default",
|
|
256
|
+
node
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
259
|
return defineRuleListener({ "JSXElement, JSXFragment": flow(getReportDescriptor(context), report(context)) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.59",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for debugging related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"@typescript-eslint/types": "canary",
|
|
44
44
|
"@typescript-eslint/utils": "canary",
|
|
45
45
|
"ts-pattern": "^5.9.0",
|
|
46
|
-
"@eslint-react/ast": "3.0.0-next.
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/shared": "3.0.0-next.
|
|
50
|
-
"@eslint-react/var": "3.0.0-next.
|
|
46
|
+
"@eslint-react/ast": "3.0.0-next.59",
|
|
47
|
+
"@eslint-react/core": "3.0.0-next.59",
|
|
48
|
+
"@eslint-react/eff": "3.0.0-next.59",
|
|
49
|
+
"@eslint-react/shared": "3.0.0-next.59",
|
|
50
|
+
"@eslint-react/var": "3.0.0-next.59"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "^19.2.14",
|