eslint-plugin-react-rsc 5.2.1-beta.1 → 5.2.1-beta.3
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 +4 -3
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";
|
|
2
2
|
import * as ast from "@eslint-react/ast";
|
|
3
|
+
import * as core from "@eslint-react/core";
|
|
3
4
|
import { merge } from "@eslint-react/eslint";
|
|
4
5
|
import { resolve } from "@eslint-react/var";
|
|
5
6
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
@@ -33,7 +34,7 @@ const rules$4 = { "react-rsc/function-definition": "off" };
|
|
|
33
34
|
//#endregion
|
|
34
35
|
//#region package.json
|
|
35
36
|
var name$4 = "eslint-plugin-react-rsc";
|
|
36
|
-
var version = "5.2.1-beta.
|
|
37
|
+
var version = "5.2.1-beta.3";
|
|
37
38
|
|
|
38
39
|
//#endregion
|
|
39
40
|
//#region src/utils/create-rule.ts
|
|
@@ -62,7 +63,7 @@ var function_definition_default = createRule({
|
|
|
62
63
|
});
|
|
63
64
|
function create(context) {
|
|
64
65
|
if (!context.sourceCode.text.includes("use server")) return {};
|
|
65
|
-
const hasFileLevelUseServerDirective = ast.
|
|
66
|
+
const hasFileLevelUseServerDirective = ast.isFileHasDirective(context.sourceCode.ast, "use server");
|
|
66
67
|
/**
|
|
67
68
|
* Check if `node` is an async function, and report if not
|
|
68
69
|
* @param node The function node to check
|
|
@@ -94,7 +95,7 @@ function create(context) {
|
|
|
94
95
|
* @param node The function node to check
|
|
95
96
|
*/
|
|
96
97
|
function checkLocalServerFunction(node) {
|
|
97
|
-
if (
|
|
98
|
+
if (core.getFunctionDirectives(node).some((d) => d.directive === "use server")) reportNonAsyncFunction(node, "local");
|
|
98
99
|
}
|
|
99
100
|
/**
|
|
100
101
|
* Find function declarations from exports and check them
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-rsc",
|
|
3
|
-
"version": "5.2.1-beta.
|
|
3
|
+
"version": "5.2.1-beta.3",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for RSC related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"@typescript-eslint/types": "^8.58.1",
|
|
43
43
|
"@typescript-eslint/utils": "^8.58.1",
|
|
44
44
|
"ts-pattern": "^5.9.0",
|
|
45
|
-
"@eslint-react/ast": "5.2.1-beta.
|
|
46
|
-
"@eslint-react/eslint": "5.2.1-beta.
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
45
|
+
"@eslint-react/ast": "5.2.1-beta.3",
|
|
46
|
+
"@eslint-react/eslint": "5.2.1-beta.3",
|
|
47
|
+
"@eslint-react/shared": "5.2.1-beta.3",
|
|
48
|
+
"@eslint-react/var": "5.2.1-beta.3",
|
|
49
|
+
"@eslint-react/core": "5.2.1-beta.3"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@types/react": "^19.2.14",
|