eslint-plugin-react-rsc 3.0.0-beta.61 → 3.0.0-beta.63
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 +10 -10
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { unit } from "@eslint-react/eff";
|
|
2
2
|
import { DEFAULT_ESLINT_REACT_SETTINGS, WEBSITE_URL, defineRuleListener } from "@eslint-react/shared";
|
|
3
3
|
import * as ast from "@eslint-react/ast";
|
|
4
|
-
import { findVariable } from "@eslint-react/var";
|
|
5
4
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
5
|
+
import { findVariable } from "@typescript-eslint/utils/ast-utils";
|
|
6
6
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
7
7
|
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
@@ -33,7 +33,7 @@ const rules$4 = { "react-rsc/function-definition": "off" };
|
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region package.json
|
|
35
35
|
var name$4 = "eslint-plugin-react-rsc";
|
|
36
|
-
var version = "3.0.0-beta.
|
|
36
|
+
var version = "3.0.0-beta.63";
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/utils/create-rule.ts
|
|
@@ -102,14 +102,7 @@ function create(context) {
|
|
|
102
102
|
* @param node The export declaration node
|
|
103
103
|
*/
|
|
104
104
|
function findAndCheckExportedFunctionDeclarations(id, node) {
|
|
105
|
-
|
|
106
|
-
if (v == null) return unit;
|
|
107
|
-
const def = v.defs.at(0);
|
|
108
|
-
if (def == null) return unit;
|
|
109
|
-
if ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)) return def.node.init;
|
|
110
|
-
return def.node;
|
|
111
|
-
}
|
|
112
|
-
const initNode = resolve(findVariable(id.name, context.sourceCode.getScope(node)));
|
|
105
|
+
const initNode = resolve(findVariable(context.sourceCode.getScope(node), id.name));
|
|
113
106
|
if (initNode == null || !ast.isFunction(initNode)) return;
|
|
114
107
|
reportNonAsyncFunction(initNode, "file");
|
|
115
108
|
}
|
|
@@ -141,6 +134,13 @@ function create(context) {
|
|
|
141
134
|
}
|
|
142
135
|
});
|
|
143
136
|
}
|
|
137
|
+
function resolve(v) {
|
|
138
|
+
if (v == null) return unit;
|
|
139
|
+
const def = v.defs.at(0);
|
|
140
|
+
if (def == null) return unit;
|
|
141
|
+
if ("init" in def.node && def.node.init != null && !("declarations" in def.node.init)) return def.node.init;
|
|
142
|
+
return def.node;
|
|
143
|
+
}
|
|
144
144
|
|
|
145
145
|
//#endregion
|
|
146
146
|
//#region src/plugin.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-rsc",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.63",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for RSC related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,13 +37,15 @@
|
|
|
37
37
|
"./package.json"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@typescript-eslint/scope-manager": "canary",
|
|
41
|
+
"@typescript-eslint/type-utils": "canary",
|
|
40
42
|
"@typescript-eslint/types": "canary",
|
|
41
43
|
"@typescript-eslint/utils": "canary",
|
|
42
44
|
"ts-pattern": "^5.9.0",
|
|
43
|
-
"@eslint-react/ast": "3.0.0-beta.
|
|
44
|
-
"@eslint-react/eff": "3.0.0-beta.
|
|
45
|
-
"@eslint-react/shared": "3.0.0-beta.
|
|
46
|
-
"@eslint-react/var": "3.0.0-beta.
|
|
45
|
+
"@eslint-react/ast": "3.0.0-beta.63",
|
|
46
|
+
"@eslint-react/eff": "3.0.0-beta.63",
|
|
47
|
+
"@eslint-react/shared": "3.0.0-beta.63",
|
|
48
|
+
"@eslint-react/var": "3.0.0-beta.63"
|
|
47
49
|
},
|
|
48
50
|
"devDependencies": {
|
|
49
51
|
"@types/react": "^19.2.14",
|