eslint-plugin-react-debug 5.24.3 → 5.24.5
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 +18 -59
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -10,44 +10,32 @@ import { findVariable } from "@typescript-eslint/utils/ast-utils";
|
|
|
10
10
|
import { getElementFullType, isFragmentElement } from "@eslint-react/jsx";
|
|
11
11
|
import { P, match } from "ts-pattern";
|
|
12
12
|
import ts from "typescript";
|
|
13
|
-
|
|
14
13
|
//#region \0rolldown/runtime.js
|
|
15
14
|
var __defProp = Object.defineProperty;
|
|
16
15
|
var __exportAll = (all, no_symbols) => {
|
|
17
16
|
let target = {};
|
|
18
|
-
for (var name in all) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
if (!no_symbols) {
|
|
25
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
26
|
-
}
|
|
17
|
+
for (var name in all) __defProp(target, name, {
|
|
18
|
+
get: all[name],
|
|
19
|
+
enumerable: true
|
|
20
|
+
});
|
|
21
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
27
22
|
return target;
|
|
28
23
|
};
|
|
29
|
-
|
|
30
24
|
//#endregion
|
|
31
25
|
//#region package.json
|
|
32
26
|
var name$1 = "eslint-plugin-react-debug";
|
|
33
|
-
var version = "5.24.
|
|
34
|
-
|
|
27
|
+
var version = "5.24.5";
|
|
35
28
|
//#endregion
|
|
36
29
|
//#region src/utils/create-rule.ts
|
|
37
30
|
function getDocsUrl(ruleName) {
|
|
38
31
|
return `https://eslint-react.xyz/docs/rules/debug-${ruleName}`;
|
|
39
32
|
}
|
|
40
33
|
const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
41
|
-
|
|
42
34
|
//#endregion
|
|
43
35
|
//#region src/utils/stringify.ts
|
|
44
36
|
function stringify(value) {
|
|
45
37
|
return JSON.stringify(value, null, 2);
|
|
46
38
|
}
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/rules/function-component/function-component.ts
|
|
50
|
-
const RULE_NAME$4 = "function-component";
|
|
51
39
|
var function_component_default = createRule({
|
|
52
40
|
meta: {
|
|
53
41
|
type: "problem",
|
|
@@ -55,9 +43,8 @@ var function_component_default = createRule({
|
|
|
55
43
|
messages: { default: "{{json}}" },
|
|
56
44
|
schema: []
|
|
57
45
|
},
|
|
58
|
-
name:
|
|
59
|
-
create: create$4
|
|
60
|
-
defaultOptions: []
|
|
46
|
+
name: "function-component",
|
|
47
|
+
create: create$4
|
|
61
48
|
});
|
|
62
49
|
function create$4(context) {
|
|
63
50
|
const { api, visitor } = core.getFunctionComponentCollector(context, {
|
|
@@ -78,10 +65,6 @@ function create$4(context) {
|
|
|
78
65
|
});
|
|
79
66
|
} });
|
|
80
67
|
}
|
|
81
|
-
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region src/rules/hook/hook.ts
|
|
84
|
-
const RULE_NAME$3 = "hook";
|
|
85
68
|
var hook_default = createRule({
|
|
86
69
|
meta: {
|
|
87
70
|
type: "problem",
|
|
@@ -89,9 +72,8 @@ var hook_default = createRule({
|
|
|
89
72
|
messages: { default: "{{json}}" },
|
|
90
73
|
schema: []
|
|
91
74
|
},
|
|
92
|
-
name:
|
|
93
|
-
create: create$3
|
|
94
|
-
defaultOptions: []
|
|
75
|
+
name: "hook",
|
|
76
|
+
create: create$3
|
|
95
77
|
});
|
|
96
78
|
function create$3(context) {
|
|
97
79
|
const { api, visitor } = core.getHookCollector(context);
|
|
@@ -106,7 +88,6 @@ function create$3(context) {
|
|
|
106
88
|
});
|
|
107
89
|
} });
|
|
108
90
|
}
|
|
109
|
-
|
|
110
91
|
//#endregion
|
|
111
92
|
//#region src/rules/is-from-react/lib.ts
|
|
112
93
|
function isFromReact(node, initialScope, importSource = "react") {
|
|
@@ -117,10 +98,6 @@ function isFromReact(node, initialScope, importSource = "react") {
|
|
|
117
98
|
default: return isInitializedFromReact(name, initialScope, importSource);
|
|
118
99
|
}
|
|
119
100
|
}
|
|
120
|
-
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/rules/is-from-react/is-from-react.ts
|
|
123
|
-
const RULE_NAME$2 = "is-from-react";
|
|
124
101
|
var is_from_react_default = createRule({
|
|
125
102
|
meta: {
|
|
126
103
|
type: "problem",
|
|
@@ -128,17 +105,15 @@ var is_from_react_default = createRule({
|
|
|
128
105
|
messages: { default: "{{json}}" },
|
|
129
106
|
schema: []
|
|
130
107
|
},
|
|
131
|
-
name:
|
|
132
|
-
create: create$2
|
|
133
|
-
defaultOptions: []
|
|
108
|
+
name: "is-from-react",
|
|
109
|
+
create: create$2
|
|
134
110
|
});
|
|
135
111
|
function create$2(context) {
|
|
136
112
|
const { importSource } = getSettingsFromContext(context);
|
|
137
113
|
function visit(node) {
|
|
138
114
|
if (node.parent.type === AST_NODE_TYPES.ImportSpecifier && node.parent.imported === node && node.parent.imported.name === node.parent.local.name) return;
|
|
139
115
|
const name = node.name;
|
|
140
|
-
|
|
141
|
-
if (!isFromReact(node, initialScope, importSource)) return;
|
|
116
|
+
if (!isFromReact(node, context.sourceCode.getScope(node), importSource)) return;
|
|
142
117
|
context.report({
|
|
143
118
|
data: { json: stringify({
|
|
144
119
|
name,
|
|
@@ -153,7 +128,6 @@ function create$2(context) {
|
|
|
153
128
|
JSXIdentifier: visit
|
|
154
129
|
};
|
|
155
130
|
}
|
|
156
|
-
|
|
157
131
|
//#endregion
|
|
158
132
|
//#region src/rules/is-from-ref/lib.ts
|
|
159
133
|
function getRefInitNode(context, node, initialScope) {
|
|
@@ -177,10 +151,6 @@ function getRefInit(context, name, initialScope) {
|
|
|
177
151
|
}
|
|
178
152
|
return null;
|
|
179
153
|
}
|
|
180
|
-
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/rules/is-from-ref/is-from-ref.ts
|
|
183
|
-
const RULE_NAME$1 = "is-from-ref";
|
|
184
154
|
var is_from_ref_default = createRule({
|
|
185
155
|
meta: {
|
|
186
156
|
type: "problem",
|
|
@@ -188,14 +158,12 @@ var is_from_ref_default = createRule({
|
|
|
188
158
|
messages: { default: "{{json}}" },
|
|
189
159
|
schema: []
|
|
190
160
|
},
|
|
191
|
-
name:
|
|
192
|
-
create: create$1
|
|
193
|
-
defaultOptions: []
|
|
161
|
+
name: "is-from-ref",
|
|
162
|
+
create: create$1
|
|
194
163
|
});
|
|
195
164
|
function create$1(context) {
|
|
196
165
|
function visit(node) {
|
|
197
|
-
const
|
|
198
|
-
const refInit = getRefInitNode(context, node, initialScope);
|
|
166
|
+
const refInit = getRefInitNode(context, node, context.sourceCode.getScope(node));
|
|
199
167
|
if (refInit == null) return;
|
|
200
168
|
context.report({
|
|
201
169
|
data: { json: stringify({
|
|
@@ -211,10 +179,6 @@ function create$1(context) {
|
|
|
211
179
|
JSXIdentifier: visit
|
|
212
180
|
};
|
|
213
181
|
}
|
|
214
|
-
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region src/rules/jsx/jsx.ts
|
|
217
|
-
const RULE_NAME = "jsx";
|
|
218
182
|
var jsx_default = createRule({
|
|
219
183
|
meta: {
|
|
220
184
|
type: "problem",
|
|
@@ -223,8 +187,7 @@ var jsx_default = createRule({
|
|
|
223
187
|
schema: []
|
|
224
188
|
},
|
|
225
189
|
name: "jsx",
|
|
226
|
-
create
|
|
227
|
-
defaultOptions: []
|
|
190
|
+
create
|
|
228
191
|
});
|
|
229
192
|
function create(context) {
|
|
230
193
|
const jsxConfig = core.getJsxConfig(context);
|
|
@@ -248,7 +211,6 @@ function create(context) {
|
|
|
248
211
|
JSXFragment: visit
|
|
249
212
|
};
|
|
250
213
|
}
|
|
251
|
-
|
|
252
214
|
//#endregion
|
|
253
215
|
//#region src/plugin.ts
|
|
254
216
|
const plugin = {
|
|
@@ -264,7 +226,6 @@ const plugin = {
|
|
|
264
226
|
["jsx"]: jsx_default
|
|
265
227
|
}
|
|
266
228
|
};
|
|
267
|
-
|
|
268
229
|
//#endregion
|
|
269
230
|
//#region src/configs/all.ts
|
|
270
231
|
var all_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -283,7 +244,6 @@ const rules = {
|
|
|
283
244
|
};
|
|
284
245
|
const plugins = { "react-debug": plugin };
|
|
285
246
|
const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
286
|
-
|
|
287
247
|
//#endregion
|
|
288
248
|
//#region src/index.ts
|
|
289
249
|
function createConfig(base) {
|
|
@@ -301,6 +261,5 @@ const finalPlugin = {
|
|
|
301
261
|
...plugin,
|
|
302
262
|
configs: { ["all"]: createConfig(all_exports) }
|
|
303
263
|
};
|
|
304
|
-
|
|
305
264
|
//#endregion
|
|
306
|
-
export { finalPlugin as default };
|
|
265
|
+
export { finalPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "5.24.
|
|
3
|
+
"version": "5.24.5",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for debugging related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.24.
|
|
41
|
-
"@eslint-react/core": "5.24.
|
|
42
|
-
"@eslint-react/eslint": "5.24.
|
|
43
|
-
"@eslint-react/jsx": "5.24.
|
|
44
|
-
"@eslint-react/shared": "5.24.
|
|
45
|
-
"@eslint-react/var": "5.24.
|
|
40
|
+
"@eslint-react/ast": "5.24.5",
|
|
41
|
+
"@eslint-react/core": "5.24.5",
|
|
42
|
+
"@eslint-react/eslint": "5.24.5",
|
|
43
|
+
"@eslint-react/jsx": "5.24.5",
|
|
44
|
+
"@eslint-react/shared": "5.24.5",
|
|
45
|
+
"@eslint-react/var": "5.24.5",
|
|
46
46
|
"@typescript-eslint/scope-manager": "^8.71.0",
|
|
47
47
|
"@typescript-eslint/types": "^8.71.0",
|
|
48
48
|
"@typescript-eslint/utils": "^8.71.0",
|