eslint-plugin-react-debug 2.0.1-beta.4 → 2.0.1-next.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 +12 -11
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS, getConfigAdapters, getDocsUrl, getSettingsFromContext } from "@eslint-react/shared";
|
|
2
|
-
import
|
|
2
|
+
import * as ER from "@eslint-react/core";
|
|
3
|
+
import { JsxEmit, getElementType, getJsxConfigFromAnnotation, getJsxConfigFromContext, isFragmentElement } from "@eslint-react/core";
|
|
3
4
|
import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
4
5
|
import { flow } from "@eslint-react/eff";
|
|
5
6
|
import { report } from "@eslint-react/kit";
|
|
@@ -37,7 +38,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
37
38
|
//#endregion
|
|
38
39
|
//#region package.json
|
|
39
40
|
var name = "eslint-plugin-react-debug";
|
|
40
|
-
var version = "2.0.1-
|
|
41
|
+
var version = "2.0.1-next.1";
|
|
41
42
|
|
|
42
43
|
//#endregion
|
|
43
44
|
//#region src/utils/create-rule.ts
|
|
@@ -68,7 +69,7 @@ var class_component_default = createRule({
|
|
|
68
69
|
defaultOptions: []
|
|
69
70
|
});
|
|
70
71
|
function create$4(context) {
|
|
71
|
-
const { ctx, listeners } = useComponentCollectorLegacy();
|
|
72
|
+
const { ctx, listeners } = ER.useComponentCollectorLegacy();
|
|
72
73
|
return {
|
|
73
74
|
...listeners,
|
|
74
75
|
"Program:exit"(program) {
|
|
@@ -101,10 +102,10 @@ var function_component_default = createRule({
|
|
|
101
102
|
defaultOptions: []
|
|
102
103
|
});
|
|
103
104
|
function create$3(context) {
|
|
104
|
-
const { ctx, listeners } = useComponentCollector(context, {
|
|
105
|
+
const { ctx, listeners } = ER.useComponentCollector(context, {
|
|
105
106
|
collectDisplayName: true,
|
|
106
107
|
collectHookCalls: true,
|
|
107
|
-
hint: DEFAULT_COMPONENT_DETECTION_HINT
|
|
108
|
+
hint: ER.DEFAULT_COMPONENT_DETECTION_HINT
|
|
108
109
|
});
|
|
109
110
|
return {
|
|
110
111
|
...listeners,
|
|
@@ -116,9 +117,9 @@ function create$3(context) {
|
|
|
116
117
|
data: { json: stringify({
|
|
117
118
|
name: name$2,
|
|
118
119
|
displayName: displayName == null ? "none" : context.sourceCode.getText(displayName),
|
|
119
|
-
forwardRef: (flag & ComponentFlag.ForwardRef) > 0n,
|
|
120
|
+
forwardRef: (flag & ER.ComponentFlag.ForwardRef) > 0n,
|
|
120
121
|
hookCalls: hookCalls.length,
|
|
121
|
-
memo: (flag & ComponentFlag.Memo) > 0n
|
|
122
|
+
memo: (flag & ER.ComponentFlag.Memo) > 0n
|
|
122
123
|
}) }
|
|
123
124
|
});
|
|
124
125
|
}
|
|
@@ -144,7 +145,7 @@ var hook_default = createRule({
|
|
|
144
145
|
defaultOptions: []
|
|
145
146
|
});
|
|
146
147
|
function create$2(context) {
|
|
147
|
-
const { ctx, listeners } = useHookCollector();
|
|
148
|
+
const { ctx, listeners } = ER.useHookCollector();
|
|
148
149
|
return {
|
|
149
150
|
...listeners,
|
|
150
151
|
"Program:exit"(program) {
|
|
@@ -210,9 +211,9 @@ function create$1(context) {
|
|
|
210
211
|
function isFromReact(node, importSource, initialScope) {
|
|
211
212
|
const name$2 = node.name;
|
|
212
213
|
switch (true) {
|
|
213
|
-
case node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier: return isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
214
|
-
case node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier: return isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
215
|
-
default: return isInitializedFromReact(name$2, importSource, initialScope);
|
|
214
|
+
case node.parent.type === AST_NODE_TYPES.MemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.Identifier: return ER.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
215
|
+
case node.parent.type === AST_NODE_TYPES.JSXMemberExpression && node.parent.property === node && node.parent.object.type === AST_NODE_TYPES.JSXIdentifier: return ER.isInitializedFromReact(node.parent.object.name, importSource, initialScope);
|
|
216
|
+
default: return ER.isInitializedFromReact(name$2, importSource, initialScope);
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-debug",
|
|
3
|
-
"version": "2.0.1-
|
|
3
|
+
"version": "2.0.1-next.1",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for debugging related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"@typescript-eslint/utils": "^8.44.1",
|
|
42
42
|
"string-ts": "^2.2.1",
|
|
43
43
|
"ts-pattern": "^5.8.0",
|
|
44
|
-
"@eslint-react/
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/eff": "2.0.1-
|
|
47
|
-
"@eslint-react/kit": "2.0.1-
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
44
|
+
"@eslint-react/ast": "2.0.1-next.1",
|
|
45
|
+
"@eslint-react/core": "2.0.1-next.1",
|
|
46
|
+
"@eslint-react/eff": "2.0.1-next.1",
|
|
47
|
+
"@eslint-react/kit": "2.0.1-next.1",
|
|
48
|
+
"@eslint-react/var": "2.0.1-next.1",
|
|
49
|
+
"@eslint-react/shared": "2.0.1-next.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@types/react": "^19.1.
|
|
52
|
+
"@types/react": "^19.1.13",
|
|
53
53
|
"@types/react-dom": "^19.1.9",
|
|
54
54
|
"tsdown": "^0.15.4",
|
|
55
55
|
"@local/configs": "0.0.0"
|