eslint-plugin-react-web-api 2.0.7-next.2 → 2.1.0-beta.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 +5 -12
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region package.json
|
|
39
39
|
var name = "eslint-plugin-react-web-api";
|
|
40
|
-
var version = "2.0
|
|
40
|
+
var version = "2.1.0-beta.0";
|
|
41
41
|
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/utils/create-rule.ts
|
|
@@ -90,8 +90,7 @@ function getOptions(node, initialScope) {
|
|
|
90
90
|
function getOpts(node$1) {
|
|
91
91
|
switch (node$1.type) {
|
|
92
92
|
case AST_NODE_TYPES.Identifier: {
|
|
93
|
-
const
|
|
94
|
-
const variableNode = getVariableDefinitionNode(variable, 0);
|
|
93
|
+
const variableNode = getVariableDefinitionNode(findVariable(node$1, initialScope), 0);
|
|
95
94
|
if (variableNode?.type === AST_NODE_TYPES.ObjectExpression) return getOpts(variableNode);
|
|
96
95
|
return defaultOptions;
|
|
97
96
|
}
|
|
@@ -100,13 +99,11 @@ function getOptions(node, initialScope) {
|
|
|
100
99
|
capture: Boolean(node$1.value)
|
|
101
100
|
};
|
|
102
101
|
case AST_NODE_TYPES.ObjectExpression: {
|
|
103
|
-
const
|
|
104
|
-
const vCapture = !!getPropValue(pCapture);
|
|
102
|
+
const vCapture = !!getPropValue(findProp(node$1.properties, "capture"));
|
|
105
103
|
const pSignal = findProp(node$1.properties, "signal");
|
|
106
|
-
const vSignal = pSignal?.type === AST_NODE_TYPES.Property ? getSignalValueExpression(pSignal.value, initialScope) : unit;
|
|
107
104
|
return {
|
|
108
105
|
capture: vCapture,
|
|
109
|
-
signal:
|
|
106
|
+
signal: pSignal?.type === AST_NODE_TYPES.Property ? getSignalValueExpression(pSignal.value, initialScope) : unit
|
|
110
107
|
};
|
|
111
108
|
}
|
|
112
109
|
default: return defaultOptions;
|
|
@@ -360,11 +357,7 @@ function isNewResizeObserver(node) {
|
|
|
360
357
|
}
|
|
361
358
|
function isFromObserver(context, node) {
|
|
362
359
|
switch (true) {
|
|
363
|
-
case node.type === AST_NODE_TYPES.Identifier:
|
|
364
|
-
const initialScope = context.sourceCode.getScope(node);
|
|
365
|
-
const object = getVariableDefinitionNode(findVariable(node, initialScope), 0);
|
|
366
|
-
return isNewResizeObserver(object);
|
|
367
|
-
}
|
|
360
|
+
case node.type === AST_NODE_TYPES.Identifier: return isNewResizeObserver(getVariableDefinitionNode(findVariable(node, context.sourceCode.getScope(node)), 0));
|
|
368
361
|
case node.type === AST_NODE_TYPES.MemberExpression: return isFromObserver(context, node.object);
|
|
369
362
|
default: return false;
|
|
370
363
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0-beta.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@typescript-eslint/utils": "^8.46.0",
|
|
41
41
|
"string-ts": "^2.2.1",
|
|
42
42
|
"ts-pattern": "^5.8.0",
|
|
43
|
-
"@eslint-react/ast": "2.0
|
|
44
|
-
"@eslint-react/core": "2.0
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/var": "2.0
|
|
48
|
-
"@eslint-react/shared": "2.0
|
|
43
|
+
"@eslint-react/ast": "2.1.0-beta.0",
|
|
44
|
+
"@eslint-react/core": "2.1.0-beta.0",
|
|
45
|
+
"@eslint-react/eff": "2.1.0-beta.0",
|
|
46
|
+
"@eslint-react/kit": "2.1.0-beta.0",
|
|
47
|
+
"@eslint-react/var": "2.1.0-beta.0",
|
|
48
|
+
"@eslint-react/shared": "2.1.0-beta.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/react": "^19.2.
|
|
52
|
-
"@types/react-dom": "^19.2.
|
|
51
|
+
"@types/react": "^19.2.2",
|
|
52
|
+
"@types/react-dom": "^19.2.1",
|
|
53
53
|
"tsdown": "^0.15.6",
|
|
54
54
|
"@local/configs": "0.0.0"
|
|
55
55
|
},
|