eslint-plugin-react-debug 1.43.2-next.1 → 1.45.0-beta.3
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 -17
- package/dist/index.mjs +14 -18
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var shared = require('@eslint-react/shared');
|
|
4
4
|
var ER2 = require('@eslint-react/core');
|
|
5
5
|
var utils = require('@typescript-eslint/utils');
|
|
6
|
+
var eff = require('@eslint-react/eff');
|
|
6
7
|
var JSX = require('@eslint-react/jsx');
|
|
7
8
|
var kit = require('@eslint-react/kit');
|
|
8
9
|
var types = require('@typescript-eslint/types');
|
|
@@ -57,7 +58,7 @@ var settings = {
|
|
|
57
58
|
|
|
58
59
|
// package.json
|
|
59
60
|
var name2 = "eslint-plugin-react-debug";
|
|
60
|
-
var version = "1.
|
|
61
|
+
var version = "1.45.0-beta.3";
|
|
61
62
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
|
|
62
63
|
|
|
63
64
|
// src/rules/class-component.ts
|
|
@@ -85,8 +86,8 @@ function create(context) {
|
|
|
85
86
|
const { ctx, listeners } = ER2__namespace.useComponentCollectorLegacy();
|
|
86
87
|
return {
|
|
87
88
|
...listeners,
|
|
88
|
-
"Program:exit"(
|
|
89
|
-
const components = ctx.getAllComponents(
|
|
89
|
+
"Program:exit"(program) {
|
|
90
|
+
const components = ctx.getAllComponents(program);
|
|
90
91
|
for (const { name: name3 = "anonymous", node: component } of components.values()) {
|
|
91
92
|
context.report({
|
|
92
93
|
messageId: "classComponent",
|
|
@@ -130,12 +131,12 @@ function create2(context) {
|
|
|
130
131
|
);
|
|
131
132
|
return {
|
|
132
133
|
...listeners,
|
|
133
|
-
"Program:exit"(
|
|
134
|
-
const components = ctx.getAllComponents(
|
|
135
|
-
for (const { name: name3 = "anonymous", node
|
|
134
|
+
"Program:exit"(program) {
|
|
135
|
+
const components = ctx.getAllComponents(program);
|
|
136
|
+
for (const { name: name3 = "anonymous", node, displayName, flag, hookCalls } of components.values()) {
|
|
136
137
|
context.report({
|
|
137
138
|
messageId: "functionComponent",
|
|
138
|
-
node
|
|
139
|
+
node,
|
|
139
140
|
data: {
|
|
140
141
|
name: name3,
|
|
141
142
|
displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
|
|
@@ -172,12 +173,12 @@ function create3(context) {
|
|
|
172
173
|
const { ctx, listeners } = ER2__namespace.useHookCollector();
|
|
173
174
|
return {
|
|
174
175
|
...listeners,
|
|
175
|
-
"Program:exit"(
|
|
176
|
-
const allHooks = ctx.getAllHooks(
|
|
177
|
-
for (const { name: name3, node
|
|
176
|
+
"Program:exit"(program) {
|
|
177
|
+
const allHooks = ctx.getAllHooks(program);
|
|
178
|
+
for (const { name: name3, node, hookCalls } of allHooks.values()) {
|
|
178
179
|
context.report({
|
|
179
180
|
messageId: "hook",
|
|
180
|
-
node
|
|
181
|
+
node,
|
|
181
182
|
data: {
|
|
182
183
|
name: name3,
|
|
183
184
|
hookCalls: hookCalls.length
|
|
@@ -283,12 +284,7 @@ function create5(context) {
|
|
|
283
284
|
};
|
|
284
285
|
}
|
|
285
286
|
return {
|
|
286
|
-
JSXElement(
|
|
287
|
-
context.report(getReportDescriptor(node));
|
|
288
|
-
},
|
|
289
|
-
JSXFragment(node) {
|
|
290
|
-
context.report(getReportDescriptor(node));
|
|
291
|
-
}
|
|
287
|
+
"JSXElement, JSXFragment": eff.flow(getReportDescriptor, kit.createReport(context))
|
|
292
288
|
};
|
|
293
289
|
}
|
|
294
290
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getDocsUrl, getSettingsFromContext, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
|
|
2
2
|
import * as ER2 from '@eslint-react/core';
|
|
3
3
|
import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
4
|
+
import { flow } from '@eslint-react/eff';
|
|
4
5
|
import * as JSX from '@eslint-react/jsx';
|
|
5
|
-
import { JsxConfig } from '@eslint-react/kit';
|
|
6
|
+
import { JsxConfig, createReport } from '@eslint-react/kit';
|
|
6
7
|
import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from '@typescript-eslint/types';
|
|
7
8
|
import { match, P } from 'ts-pattern';
|
|
8
9
|
import { JsxEmit } from 'typescript';
|
|
@@ -34,7 +35,7 @@ var settings = {
|
|
|
34
35
|
|
|
35
36
|
// package.json
|
|
36
37
|
var name2 = "eslint-plugin-react-debug";
|
|
37
|
-
var version = "1.
|
|
38
|
+
var version = "1.45.0-beta.3";
|
|
38
39
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
|
|
39
40
|
|
|
40
41
|
// src/rules/class-component.ts
|
|
@@ -62,8 +63,8 @@ function create(context) {
|
|
|
62
63
|
const { ctx, listeners } = ER2.useComponentCollectorLegacy();
|
|
63
64
|
return {
|
|
64
65
|
...listeners,
|
|
65
|
-
"Program:exit"(
|
|
66
|
-
const components = ctx.getAllComponents(
|
|
66
|
+
"Program:exit"(program) {
|
|
67
|
+
const components = ctx.getAllComponents(program);
|
|
67
68
|
for (const { name: name3 = "anonymous", node: component } of components.values()) {
|
|
68
69
|
context.report({
|
|
69
70
|
messageId: "classComponent",
|
|
@@ -107,12 +108,12 @@ function create2(context) {
|
|
|
107
108
|
);
|
|
108
109
|
return {
|
|
109
110
|
...listeners,
|
|
110
|
-
"Program:exit"(
|
|
111
|
-
const components = ctx.getAllComponents(
|
|
112
|
-
for (const { name: name3 = "anonymous", node
|
|
111
|
+
"Program:exit"(program) {
|
|
112
|
+
const components = ctx.getAllComponents(program);
|
|
113
|
+
for (const { name: name3 = "anonymous", node, displayName, flag, hookCalls } of components.values()) {
|
|
113
114
|
context.report({
|
|
114
115
|
messageId: "functionComponent",
|
|
115
|
-
node
|
|
116
|
+
node,
|
|
116
117
|
data: {
|
|
117
118
|
name: name3,
|
|
118
119
|
displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
|
|
@@ -149,12 +150,12 @@ function create3(context) {
|
|
|
149
150
|
const { ctx, listeners } = ER2.useHookCollector();
|
|
150
151
|
return {
|
|
151
152
|
...listeners,
|
|
152
|
-
"Program:exit"(
|
|
153
|
-
const allHooks = ctx.getAllHooks(
|
|
154
|
-
for (const { name: name3, node
|
|
153
|
+
"Program:exit"(program) {
|
|
154
|
+
const allHooks = ctx.getAllHooks(program);
|
|
155
|
+
for (const { name: name3, node, hookCalls } of allHooks.values()) {
|
|
155
156
|
context.report({
|
|
156
157
|
messageId: "hook",
|
|
157
|
-
node
|
|
158
|
+
node,
|
|
158
159
|
data: {
|
|
159
160
|
name: name3,
|
|
160
161
|
hookCalls: hookCalls.length
|
|
@@ -260,12 +261,7 @@ function create5(context) {
|
|
|
260
261
|
};
|
|
261
262
|
}
|
|
262
263
|
return {
|
|
263
|
-
JSXElement(
|
|
264
|
-
context.report(getReportDescriptor(node));
|
|
265
|
-
},
|
|
266
|
-
JSXFragment(node) {
|
|
267
|
-
context.report(getReportDescriptor(node));
|
|
268
|
-
}
|
|
264
|
+
"JSXElement, JSXFragment": flow(getReportDescriptor, createReport(context))
|
|
269
265
|
};
|
|
270
266
|
}
|
|
271
267
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0-beta.3",
|
|
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/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/kit": "1.
|
|
56
|
-
"@eslint-react/shared": "1.
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.45.0-beta.3",
|
|
53
|
+
"@eslint-react/core": "1.45.0-beta.3",
|
|
54
|
+
"@eslint-react/eff": "1.45.0-beta.3",
|
|
55
|
+
"@eslint-react/kit": "1.45.0-beta.3",
|
|
56
|
+
"@eslint-react/shared": "1.45.0-beta.3",
|
|
57
|
+
"@eslint-react/jsx": "1.45.0-beta.3",
|
|
58
|
+
"@eslint-react/var": "1.45.0-beta.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.0",
|