eslint-plugin-react-web-api 1.30.1-next.1 → 1.30.2-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/LICENSE +1 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +7 -7
package/LICENSE
CHANGED
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var settings = {
|
|
|
55
55
|
|
|
56
56
|
// package.json
|
|
57
57
|
var name2 = "eslint-plugin-react-web-api";
|
|
58
|
-
var version = "1.30.
|
|
58
|
+
var version = "1.30.2-next.0";
|
|
59
59
|
var createRule = shared.createRuleForPlugin("web-api");
|
|
60
60
|
function getPhaseKindOfFunction(node) {
|
|
61
61
|
return tsPattern.match(node).when(core.isFunctionOfUseEffectSetup, () => "setup").when(core.isFunctionOfUseEffectCleanup, () => "cleanup").when(core.isFunctionOfComponentDidMount, () => "mount").when(core.isFunctionOfComponentWillUnmount, () => "unmount").otherwise(() => eff._);
|
|
@@ -88,7 +88,7 @@ function getSignalValueExpression(node, initialScope) {
|
|
|
88
88
|
if (node == null) return eff._;
|
|
89
89
|
switch (node.type) {
|
|
90
90
|
case utils.AST_NODE_TYPES.Identifier: {
|
|
91
|
-
return getSignalValueExpression(VAR__namespace.
|
|
91
|
+
return getSignalValueExpression(VAR__namespace.getVariableInitNode(VAR__namespace.findVariable(node, initialScope), 0), initialScope);
|
|
92
92
|
}
|
|
93
93
|
case utils.AST_NODE_TYPES.MemberExpression:
|
|
94
94
|
return node;
|
|
@@ -120,7 +120,7 @@ function getOptions(node, initialScope) {
|
|
|
120
120
|
switch (node2.type) {
|
|
121
121
|
case utils.AST_NODE_TYPES.Identifier: {
|
|
122
122
|
const variable = VAR__namespace.findVariable(node2, initialScope);
|
|
123
|
-
const variableNode = VAR__namespace.
|
|
123
|
+
const variableNode = VAR__namespace.getVariableInitNode(variable, 0);
|
|
124
124
|
if (variableNode?.type === utils.AST_NODE_TYPES.ObjectExpression) {
|
|
125
125
|
return getOpts(variableNode);
|
|
126
126
|
}
|
|
@@ -432,7 +432,7 @@ function isFromObserver(context, node) {
|
|
|
432
432
|
switch (true) {
|
|
433
433
|
case node.type === utils.AST_NODE_TYPES.Identifier: {
|
|
434
434
|
const initialScope = context.sourceCode.getScope(node);
|
|
435
|
-
const object = VAR__namespace.
|
|
435
|
+
const object = VAR__namespace.getVariableInitNode(VAR__namespace.findVariable(node, initialScope), 0);
|
|
436
436
|
return isNewResizeObserver(object);
|
|
437
437
|
}
|
|
438
438
|
case node.type === utils.AST_NODE_TYPES.MemberExpression:
|
package/dist/index.mjs
CHANGED
|
@@ -32,7 +32,7 @@ var settings = {
|
|
|
32
32
|
|
|
33
33
|
// package.json
|
|
34
34
|
var name2 = "eslint-plugin-react-web-api";
|
|
35
|
-
var version = "1.30.
|
|
35
|
+
var version = "1.30.2-next.0";
|
|
36
36
|
var createRule = createRuleForPlugin("web-api");
|
|
37
37
|
function getPhaseKindOfFunction(node) {
|
|
38
38
|
return match(node).when(isFunctionOfUseEffectSetup, () => "setup").when(isFunctionOfUseEffectCleanup, () => "cleanup").when(isFunctionOfComponentDidMount, () => "mount").when(isFunctionOfComponentWillUnmount, () => "unmount").otherwise(() => _);
|
|
@@ -65,7 +65,7 @@ function getSignalValueExpression(node, initialScope) {
|
|
|
65
65
|
if (node == null) return _;
|
|
66
66
|
switch (node.type) {
|
|
67
67
|
case AST_NODE_TYPES.Identifier: {
|
|
68
|
-
return getSignalValueExpression(VAR.
|
|
68
|
+
return getSignalValueExpression(VAR.getVariableInitNode(VAR.findVariable(node, initialScope), 0), initialScope);
|
|
69
69
|
}
|
|
70
70
|
case AST_NODE_TYPES.MemberExpression:
|
|
71
71
|
return node;
|
|
@@ -97,7 +97,7 @@ function getOptions(node, initialScope) {
|
|
|
97
97
|
switch (node2.type) {
|
|
98
98
|
case AST_NODE_TYPES.Identifier: {
|
|
99
99
|
const variable = VAR.findVariable(node2, initialScope);
|
|
100
|
-
const variableNode = VAR.
|
|
100
|
+
const variableNode = VAR.getVariableInitNode(variable, 0);
|
|
101
101
|
if (variableNode?.type === AST_NODE_TYPES.ObjectExpression) {
|
|
102
102
|
return getOpts(variableNode);
|
|
103
103
|
}
|
|
@@ -409,7 +409,7 @@ function isFromObserver(context, node) {
|
|
|
409
409
|
switch (true) {
|
|
410
410
|
case node.type === AST_NODE_TYPES.Identifier: {
|
|
411
411
|
const initialScope = context.sourceCode.getScope(node);
|
|
412
|
-
const object = VAR.
|
|
412
|
+
const object = VAR.getVariableInitNode(VAR.findVariable(node, initialScope), 0);
|
|
413
413
|
return isNewResizeObserver(object);
|
|
414
414
|
}
|
|
415
415
|
case node.type === AST_NODE_TYPES.MemberExpression:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.2-next.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@typescript-eslint/utils": "^8.26.0",
|
|
49
49
|
"string-ts": "^2.2.1",
|
|
50
50
|
"ts-pattern": "^5.6.2",
|
|
51
|
-
"@eslint-react/ast": "1.30.
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
51
|
+
"@eslint-react/ast": "1.30.2-next.0",
|
|
52
|
+
"@eslint-react/eff": "1.30.2-next.0",
|
|
53
|
+
"@eslint-react/core": "1.30.2-next.0",
|
|
54
|
+
"@eslint-react/jsx": "1.30.2-next.0",
|
|
55
|
+
"@eslint-react/shared": "1.30.2-next.0",
|
|
56
|
+
"@eslint-react/var": "1.30.2-next.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/react": "^19.0.10",
|