eslint-plugin-react-debug 1.38.5-next.2 → 1.39.0-beta.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 +31 -11
- package/dist/index.mjs +11 -11
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var shared = require('@eslint-react/shared');
|
|
4
|
-
var
|
|
4
|
+
var ER2 = require('@eslint-react/core');
|
|
5
5
|
var utils = require('@typescript-eslint/utils');
|
|
6
6
|
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var ER2__namespace = /*#__PURE__*/_interopNamespace(ER2);
|
|
26
|
+
|
|
7
27
|
var __defProp = Object.defineProperty;
|
|
8
28
|
var __export = (target, all) => {
|
|
9
29
|
for (var name3 in all)
|
|
@@ -30,7 +50,7 @@ var settings = {
|
|
|
30
50
|
|
|
31
51
|
// package.json
|
|
32
52
|
var name2 = "eslint-plugin-react-debug";
|
|
33
|
-
var version = "1.
|
|
53
|
+
var version = "1.39.0-beta.1";
|
|
34
54
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("debug"));
|
|
35
55
|
|
|
36
56
|
// src/rules/class-component.ts
|
|
@@ -55,7 +75,7 @@ var class_component_default = createRule({
|
|
|
55
75
|
defaultOptions: []
|
|
56
76
|
});
|
|
57
77
|
function create(context) {
|
|
58
|
-
const { ctx, listeners } =
|
|
78
|
+
const { ctx, listeners } = ER2__namespace.useComponentCollectorLegacy();
|
|
59
79
|
return {
|
|
60
80
|
...listeners,
|
|
61
81
|
"Program:exit"(node) {
|
|
@@ -93,12 +113,12 @@ var function_component_default = createRule({
|
|
|
93
113
|
defaultOptions: []
|
|
94
114
|
});
|
|
95
115
|
function create2(context) {
|
|
96
|
-
const { ctx, listeners } =
|
|
116
|
+
const { ctx, listeners } = ER2__namespace.useComponentCollector(
|
|
97
117
|
context,
|
|
98
118
|
{
|
|
99
119
|
collectDisplayName: true,
|
|
100
120
|
collectHookCalls: true,
|
|
101
|
-
hint:
|
|
121
|
+
hint: ER2__namespace.DEFAULT_COMPONENT_HINT
|
|
102
122
|
}
|
|
103
123
|
);
|
|
104
124
|
return {
|
|
@@ -112,9 +132,9 @@ function create2(context) {
|
|
|
112
132
|
data: {
|
|
113
133
|
name: name3,
|
|
114
134
|
displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
|
|
115
|
-
forwardRef: (flag &
|
|
135
|
+
forwardRef: (flag & ER2__namespace.ComponentFlag.ForwardRef) > 0n,
|
|
116
136
|
hookCalls: hookCalls.length,
|
|
117
|
-
memo: (flag &
|
|
137
|
+
memo: (flag & ER2__namespace.ComponentFlag.Memo) > 0n
|
|
118
138
|
}
|
|
119
139
|
});
|
|
120
140
|
}
|
|
@@ -142,7 +162,7 @@ var hook_default = createRule({
|
|
|
142
162
|
defaultOptions: []
|
|
143
163
|
});
|
|
144
164
|
function create3(context) {
|
|
145
|
-
const { ctx, listeners } =
|
|
165
|
+
const { ctx, listeners } = ER2__namespace.useHookCollector();
|
|
146
166
|
return {
|
|
147
167
|
...listeners,
|
|
148
168
|
"Program:exit"(node) {
|
|
@@ -186,11 +206,11 @@ function create4(context) {
|
|
|
186
206
|
const name3 = node.name;
|
|
187
207
|
switch (true) {
|
|
188
208
|
case (node.parent.type === utils.AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.Identifier):
|
|
189
|
-
return
|
|
209
|
+
return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
190
210
|
case (node.parent.type === utils.AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === utils.AST_NODE_TYPES.JSXIdentifier):
|
|
191
|
-
return
|
|
211
|
+
return ER2__namespace.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
192
212
|
default:
|
|
193
|
-
return
|
|
213
|
+
return ER2__namespace.isInitializedFromReact(name3, importSource, initialScope);
|
|
194
214
|
}
|
|
195
215
|
}
|
|
196
216
|
function visitorFunction(node) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocsUrl, getSettingsFromContext, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
|
|
2
|
-
import
|
|
2
|
+
import * as ER2 from '@eslint-react/core';
|
|
3
3
|
import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
4
4
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -28,7 +28,7 @@ var settings = {
|
|
|
28
28
|
|
|
29
29
|
// package.json
|
|
30
30
|
var name2 = "eslint-plugin-react-debug";
|
|
31
|
-
var version = "1.
|
|
31
|
+
var version = "1.39.0-beta.1";
|
|
32
32
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("debug"));
|
|
33
33
|
|
|
34
34
|
// src/rules/class-component.ts
|
|
@@ -53,7 +53,7 @@ var class_component_default = createRule({
|
|
|
53
53
|
defaultOptions: []
|
|
54
54
|
});
|
|
55
55
|
function create(context) {
|
|
56
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
56
|
+
const { ctx, listeners } = ER2.useComponentCollectorLegacy();
|
|
57
57
|
return {
|
|
58
58
|
...listeners,
|
|
59
59
|
"Program:exit"(node) {
|
|
@@ -91,12 +91,12 @@ var function_component_default = createRule({
|
|
|
91
91
|
defaultOptions: []
|
|
92
92
|
});
|
|
93
93
|
function create2(context) {
|
|
94
|
-
const { ctx, listeners } = useComponentCollector(
|
|
94
|
+
const { ctx, listeners } = ER2.useComponentCollector(
|
|
95
95
|
context,
|
|
96
96
|
{
|
|
97
97
|
collectDisplayName: true,
|
|
98
98
|
collectHookCalls: true,
|
|
99
|
-
hint: DEFAULT_COMPONENT_HINT
|
|
99
|
+
hint: ER2.DEFAULT_COMPONENT_HINT
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
return {
|
|
@@ -110,9 +110,9 @@ function create2(context) {
|
|
|
110
110
|
data: {
|
|
111
111
|
name: name3,
|
|
112
112
|
displayName: displayName != null ? context.sourceCode.getText(displayName) : "none",
|
|
113
|
-
forwardRef: (flag &
|
|
113
|
+
forwardRef: (flag & ER2.ComponentFlag.ForwardRef) > 0n,
|
|
114
114
|
hookCalls: hookCalls.length,
|
|
115
|
-
memo: (flag &
|
|
115
|
+
memo: (flag & ER2.ComponentFlag.Memo) > 0n
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
}
|
|
@@ -140,7 +140,7 @@ var hook_default = createRule({
|
|
|
140
140
|
defaultOptions: []
|
|
141
141
|
});
|
|
142
142
|
function create3(context) {
|
|
143
|
-
const { ctx, listeners } = useHookCollector();
|
|
143
|
+
const { ctx, listeners } = ER2.useHookCollector();
|
|
144
144
|
return {
|
|
145
145
|
...listeners,
|
|
146
146
|
"Program:exit"(node) {
|
|
@@ -184,11 +184,11 @@ function create4(context) {
|
|
|
184
184
|
const name3 = node.name;
|
|
185
185
|
switch (true) {
|
|
186
186
|
case (node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier):
|
|
187
|
-
return isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
187
|
+
return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
188
188
|
case (node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier):
|
|
189
|
-
return isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
189
|
+
return ER2.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
190
190
|
default:
|
|
191
|
-
return isInitializedFromReact(name3, importSource, initialScope);
|
|
191
|
+
return ER2.isInitializedFromReact(name3, importSource, initialScope);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
function visitorFunction(node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.0-beta.1",
|
|
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.28.0",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.7.0",
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/eff": "1.
|
|
55
|
-
"@eslint-react/jsx": "1.
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/shared": "1.
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.39.0-beta.1",
|
|
53
|
+
"@eslint-react/core": "1.39.0-beta.1",
|
|
54
|
+
"@eslint-react/eff": "1.39.0-beta.1",
|
|
55
|
+
"@eslint-react/jsx": "1.39.0-beta.1",
|
|
56
|
+
"@eslint-react/kit": "1.39.0-beta.1",
|
|
57
|
+
"@eslint-react/shared": "1.39.0-beta.1",
|
|
58
|
+
"@eslint-react/var": "1.39.0-beta.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.0.12",
|