eslint-plugin-react-debug 1.24.0-next.0 → 1.24.0-next.11
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 +12 -4
- package/dist/index.mjs +13 -5
- package/package.json +13 -14
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var utils = require('@typescript-eslint/utils');
|
|
|
6
6
|
|
|
7
7
|
// package.json
|
|
8
8
|
var name = "eslint-plugin-react-debug";
|
|
9
|
-
var version = "1.24.0-next.
|
|
9
|
+
var version = "1.24.0-next.11";
|
|
10
10
|
var createRule = shared.createRuleForPlugin("debug");
|
|
11
11
|
|
|
12
12
|
// src/rules/class-component.ts
|
|
@@ -61,23 +61,31 @@ var function_component_default = createRule({
|
|
|
61
61
|
[Symbol.for("rule_features")]: RULE_FEATURES2
|
|
62
62
|
},
|
|
63
63
|
messages: {
|
|
64
|
-
functionComponent: "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}."
|
|
64
|
+
functionComponent: "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}."
|
|
65
65
|
},
|
|
66
66
|
schema: []
|
|
67
67
|
},
|
|
68
68
|
name: RULE_NAME2,
|
|
69
69
|
create(context) {
|
|
70
|
-
const { ctx, listeners } = core.useComponentCollector(
|
|
70
|
+
const { ctx, listeners } = core.useComponentCollector(
|
|
71
|
+
context,
|
|
72
|
+
core.DEFAULT_COMPONENT_HINT,
|
|
73
|
+
{
|
|
74
|
+
collectDisplayName: true,
|
|
75
|
+
collectHookCalls: true
|
|
76
|
+
}
|
|
77
|
+
);
|
|
71
78
|
return {
|
|
72
79
|
...listeners,
|
|
73
80
|
"Program:exit"(node) {
|
|
74
81
|
const components = ctx.getAllComponents(node);
|
|
75
|
-
for (const { name: name2 = "anonymous", node: node2, flag, hookCalls } of components.values()) {
|
|
82
|
+
for (const { name: name2 = "anonymous", node: node2, displayName, flag, hookCalls } of components.values()) {
|
|
76
83
|
context.report({
|
|
77
84
|
messageId: "functionComponent",
|
|
78
85
|
node: node2,
|
|
79
86
|
data: {
|
|
80
87
|
name: name2,
|
|
88
|
+
displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
|
|
81
89
|
forwardRef: (flag & core.ERFunctionComponentFlag.ForwardRef) > 0n,
|
|
82
90
|
hookCalls: hookCalls.length,
|
|
83
91
|
memo: (flag & core.ERFunctionComponentFlag.Memo) > 0n
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useComponentCollectorLegacy, useComponentCollector, ERFunctionComponentFlag, useHookCollector, isInitializedFromReact } from '@eslint-react/core';
|
|
1
|
+
import { useComponentCollectorLegacy, useComponentCollector, DEFAULT_COMPONENT_HINT, ERFunctionComponentFlag, useHookCollector, isInitializedFromReact } from '@eslint-react/core';
|
|
2
2
|
import { createRuleForPlugin, getSettingsFromContext } from '@eslint-react/shared';
|
|
3
3
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
4
4
|
|
|
5
5
|
// package.json
|
|
6
6
|
var name = "eslint-plugin-react-debug";
|
|
7
|
-
var version = "1.24.0-next.
|
|
7
|
+
var version = "1.24.0-next.11";
|
|
8
8
|
var createRule = createRuleForPlugin("debug");
|
|
9
9
|
|
|
10
10
|
// src/rules/class-component.ts
|
|
@@ -59,23 +59,31 @@ var function_component_default = createRule({
|
|
|
59
59
|
[Symbol.for("rule_features")]: RULE_FEATURES2
|
|
60
60
|
},
|
|
61
61
|
messages: {
|
|
62
|
-
functionComponent: "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}."
|
|
62
|
+
functionComponent: "[function component] name: {{name}}, memo: {{memo}}, forwardRef: {{forwardRef}}, hookCalls: {{hookCalls}}, displayName: {{displayName}}."
|
|
63
63
|
},
|
|
64
64
|
schema: []
|
|
65
65
|
},
|
|
66
66
|
name: RULE_NAME2,
|
|
67
67
|
create(context) {
|
|
68
|
-
const { ctx, listeners } = useComponentCollector(
|
|
68
|
+
const { ctx, listeners } = useComponentCollector(
|
|
69
|
+
context,
|
|
70
|
+
DEFAULT_COMPONENT_HINT,
|
|
71
|
+
{
|
|
72
|
+
collectDisplayName: true,
|
|
73
|
+
collectHookCalls: true
|
|
74
|
+
}
|
|
75
|
+
);
|
|
69
76
|
return {
|
|
70
77
|
...listeners,
|
|
71
78
|
"Program:exit"(node) {
|
|
72
79
|
const components = ctx.getAllComponents(node);
|
|
73
|
-
for (const { name: name2 = "anonymous", node: node2, flag, hookCalls } of components.values()) {
|
|
80
|
+
for (const { name: name2 = "anonymous", node: node2, displayName, flag, hookCalls } of components.values()) {
|
|
74
81
|
context.report({
|
|
75
82
|
messageId: "functionComponent",
|
|
76
83
|
node: node2,
|
|
77
84
|
data: {
|
|
78
85
|
name: name2,
|
|
86
|
+
displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
|
|
79
87
|
forwardRef: (flag & ERFunctionComponentFlag.ForwardRef) > 0n,
|
|
80
88
|
hookCalls: hookCalls.length,
|
|
81
89
|
memo: (flag & ERFunctionComponentFlag.Memo) > 0n
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "1.24.0-next.
|
|
3
|
+
"version": "1.24.0-next.11",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for debugging related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -41,23 +41,22 @@
|
|
|
41
41
|
"./package.json"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
45
|
-
"@typescript-eslint/type-utils": "^8.
|
|
46
|
-
"@typescript-eslint/types": "^8.
|
|
47
|
-
"@typescript-eslint/utils": "^8.
|
|
44
|
+
"@typescript-eslint/scope-manager": "^8.20.0",
|
|
45
|
+
"@typescript-eslint/type-utils": "^8.20.0",
|
|
46
|
+
"@typescript-eslint/types": "^8.20.0",
|
|
47
|
+
"@typescript-eslint/utils": "^8.20.0",
|
|
48
48
|
"string-ts": "^2.2.0",
|
|
49
49
|
"ts-pattern": "^5.6.0",
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/jsx": "1.24.0-next.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/var": "1.24.0-next.0"
|
|
50
|
+
"@eslint-react/core": "1.24.0-next.11",
|
|
51
|
+
"@eslint-react/eff": "1.24.0-next.11",
|
|
52
|
+
"@eslint-react/jsx": "1.24.0-next.11",
|
|
53
|
+
"@eslint-react/shared": "1.24.0-next.11",
|
|
54
|
+
"@eslint-react/var": "1.24.0-next.11",
|
|
55
|
+
"@eslint-react/ast": "1.24.0-next.11"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"@types/react": "^19.0.
|
|
60
|
-
"@types/react-dom": "^19.0.
|
|
58
|
+
"@types/react": "^19.0.7",
|
|
59
|
+
"@types/react-dom": "^19.0.3",
|
|
61
60
|
"tsup": "^8.3.5",
|
|
62
61
|
"@workspace/configs": "0.0.0"
|
|
63
62
|
},
|