@eslint-react/core 2.0.0-next.39 → 2.0.0-next.43
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 +9 -5
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -726,11 +726,15 @@ function useComponentCollector(context, options = {}) {
|
|
|
726
726
|
const entry = functionEntries.at(-1);
|
|
727
727
|
if (entry == null) return;
|
|
728
728
|
if (!entry.isComponent) return functionEntries.pop();
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
729
|
+
const rets = AST14.getNestedReturnStatements(entry.node.body);
|
|
730
|
+
for (let i = rets.length - 1; i >= 0; i--) {
|
|
731
|
+
const ret = rets[i];
|
|
732
|
+
if (ret == null) continue;
|
|
733
|
+
const shouldDrop = context.sourceCode.getScope(ret).block === entry.node && ret.argument != null && !isJsxLike(context.sourceCode, ret.argument, hint);
|
|
734
|
+
if (shouldDrop) {
|
|
735
|
+
components.delete(entry.key);
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
734
738
|
}
|
|
735
739
|
return functionEntries.pop();
|
|
736
740
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.43",
|
|
4
4
|
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -27,17 +27,17 @@
|
|
|
27
27
|
"./package.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
31
|
-
"@typescript-eslint/type-utils": "^8.
|
|
32
|
-
"@typescript-eslint/types": "^8.
|
|
33
|
-
"@typescript-eslint/utils": "^8.
|
|
30
|
+
"@typescript-eslint/scope-manager": "^8.34.0",
|
|
31
|
+
"@typescript-eslint/type-utils": "^8.34.0",
|
|
32
|
+
"@typescript-eslint/types": "^8.34.0",
|
|
33
|
+
"@typescript-eslint/utils": "^8.34.0",
|
|
34
34
|
"birecord": "^0.1.1",
|
|
35
35
|
"ts-pattern": "^5.7.1",
|
|
36
|
-
"@eslint-react/ast": "2.0.0-next.
|
|
37
|
-
"@eslint-react/eff": "2.0.0-next.
|
|
38
|
-
"@eslint-react/kit": "2.0.0-next.
|
|
39
|
-
"@eslint-react/var": "2.0.0-next.
|
|
40
|
-
"@eslint-react/shared": "2.0.0-next.
|
|
36
|
+
"@eslint-react/ast": "2.0.0-next.43",
|
|
37
|
+
"@eslint-react/eff": "2.0.0-next.43",
|
|
38
|
+
"@eslint-react/kit": "2.0.0-next.43",
|
|
39
|
+
"@eslint-react/var": "2.0.0-next.43",
|
|
40
|
+
"@eslint-react/shared": "2.0.0-next.43"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"tsup": "^8.5.0",
|