eslint-plugin-react-rsc 5.3.0-next.2 → 5.3.1-next.0
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 -8
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";
|
|
2
|
-
import { Check } from "@eslint-react/ast";
|
|
2
|
+
import { Check, Extract } from "@eslint-react/ast";
|
|
3
3
|
import * as core from "@eslint-react/core";
|
|
4
4
|
import { merge } from "@eslint-react/eslint";
|
|
5
5
|
import { resolve } from "@eslint-react/var";
|
|
@@ -34,7 +34,7 @@ const rules$4 = { "react-rsc/function-definition": "off" };
|
|
|
34
34
|
//#endregion
|
|
35
35
|
//#region package.json
|
|
36
36
|
var name$4 = "eslint-plugin-react-rsc";
|
|
37
|
-
var version = "5.3.
|
|
37
|
+
var version = "5.3.1-next.0";
|
|
38
38
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/utils/create-rule.ts
|
|
@@ -79,12 +79,14 @@ function create(context) {
|
|
|
79
79
|
return null;
|
|
80
80
|
}
|
|
81
81
|
function reportNonAsyncFunction(node, messageId) {
|
|
82
|
-
if (
|
|
83
|
-
|
|
82
|
+
if (node == null) return false;
|
|
83
|
+
const unwrapped = Extract.unwrap(node);
|
|
84
|
+
if (!Check.isFunction(unwrapped)) return false;
|
|
85
|
+
if (!unwrapped.async) {
|
|
84
86
|
context.report({
|
|
85
|
-
fix: getAsyncFix(
|
|
87
|
+
fix: getAsyncFix(unwrapped),
|
|
86
88
|
messageId,
|
|
87
|
-
node
|
|
89
|
+
node: unwrapped
|
|
88
90
|
});
|
|
89
91
|
return true;
|
|
90
92
|
}
|
|
@@ -104,8 +106,10 @@ function create(context) {
|
|
|
104
106
|
*/
|
|
105
107
|
function findAndCheckExportedFunctionDeclarations(id, node) {
|
|
106
108
|
const initNode = resolve(context, id);
|
|
107
|
-
if (initNode == null
|
|
108
|
-
|
|
109
|
+
if (initNode == null) return;
|
|
110
|
+
const unwrapped = Extract.unwrap(initNode);
|
|
111
|
+
if (!Check.isFunction(unwrapped)) return;
|
|
112
|
+
reportNonAsyncFunction(unwrapped, "file");
|
|
109
113
|
}
|
|
110
114
|
return merge({
|
|
111
115
|
ArrowFunctionExpression(node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-rsc",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.1-next.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for RSC related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@typescript-eslint/types": "^8.58.2",
|
|
43
43
|
"@typescript-eslint/utils": "^8.58.2",
|
|
44
44
|
"ts-pattern": "^5.9.0",
|
|
45
|
-
"@eslint-react/ast": "5.3.
|
|
46
|
-
"@eslint-react/core": "5.3.
|
|
47
|
-
"@eslint-react/shared": "5.3.
|
|
48
|
-
"@eslint-react/var": "5.3.
|
|
49
|
-
"@eslint-react/eslint": "5.3.
|
|
45
|
+
"@eslint-react/ast": "5.3.1-next.0",
|
|
46
|
+
"@eslint-react/core": "5.3.1-next.0",
|
|
47
|
+
"@eslint-react/shared": "5.3.1-next.0",
|
|
48
|
+
"@eslint-react/var": "5.3.1-next.0",
|
|
49
|
+
"@eslint-react/eslint": "5.3.1-next.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@types/react": "^19.2.14",
|