eslint-plugin-react-web-api 5.30.0-beta.4 → 5.30.0-beta.6
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 +7 -5
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as ESLintUtils from "@typescript-eslint/utils/eslint-utils";
|
|
|
3
3
|
import { Check, Compare, Extract, Traverse } from "@eslint-react/ast";
|
|
4
4
|
import { getFunctionId, isUseEffectCleanupCallback, isUseEffectSetupCallback, isUseRefLikeCall } from "@eslint-react/core";
|
|
5
5
|
import "@eslint-react/eslint";
|
|
6
|
-
import { isAssignmentTargetEqual, isInitializedFromReactNative,
|
|
6
|
+
import { isAssignmentTargetEqual, isInitializedFromReactNative, isProvenanceEqual, resolve, resolveEnclosingAssignmentTarget, resolveOrigin } from "@eslint-react/var";
|
|
7
7
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
8
8
|
import { findVariable, getStaticValue } from "@typescript-eslint/utils/ast-utils";
|
|
9
9
|
import { P, isMatching, match } from "ts-pattern";
|
|
@@ -20,7 +20,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
20
20
|
};
|
|
21
21
|
// package.json
|
|
22
22
|
var name$1 = "eslint-plugin-react-web-api";
|
|
23
|
-
var version = "5.30.0-beta.
|
|
23
|
+
var version = "5.30.0-beta.6";
|
|
24
24
|
// src/utils/create-rule.ts
|
|
25
25
|
function getDocsUrl(ruleName) {
|
|
26
26
|
return `https://eslint-react.xyz/docs/rules/web-api-${ruleName}`;
|
|
@@ -139,8 +139,10 @@ function isSignalPropertyBinding(context, node) {
|
|
|
139
139
|
}
|
|
140
140
|
return false;
|
|
141
141
|
}
|
|
142
|
-
function getSignalValueExpression(context, node) {
|
|
142
|
+
function getSignalValueExpression(context, node, seen = /* @__PURE__ */ new Set()) {
|
|
143
143
|
if (node == null) return null;
|
|
144
|
+
if (seen.has(node)) return null;
|
|
145
|
+
seen.add(node);
|
|
144
146
|
switch (node.type) {
|
|
145
147
|
case AST_NODE_TYPES.Identifier: {
|
|
146
148
|
const resolved = resolveOrigin(context, node);
|
|
@@ -150,7 +152,7 @@ function getSignalValueExpression(context, node) {
|
|
|
150
152
|
const newCallee = Extract.unwrap(unwrapped.callee);
|
|
151
153
|
if (newCallee.type === AST_NODE_TYPES.Identifier && newCallee.name === "AbortController") return node;
|
|
152
154
|
}
|
|
153
|
-
return getSignalValueExpression(context, unwrapped);
|
|
155
|
+
return getSignalValueExpression(context, unwrapped, seen);
|
|
154
156
|
}
|
|
155
157
|
case AST_NODE_TYPES.MemberExpression: return node;
|
|
156
158
|
default: return null;
|
|
@@ -272,7 +274,7 @@ function create$5(context) {
|
|
|
272
274
|
const { type: aType, callee: aCallee, capture: aCapture, effect: aEffect, listener: aListener, phase: aPhase } = aEntry;
|
|
273
275
|
const { type: rType, callee: rCallee, capture: rCapture, effect: rEffect, listener: rListener, phase: rPhase } = rEntry;
|
|
274
276
|
if (aPhase !== "setup") return false;
|
|
275
|
-
if (!isSameObject(aCallee, rCallee) || !Compare.isEqual(aListener, rListener) || !
|
|
277
|
+
if (!isSameObject(aCallee, rCallee) || !Compare.isEqual(aListener, rListener) || !isProvenanceEqual(context, aType, rType) || aCapture !== rCapture) return false;
|
|
276
278
|
if (rPhase === "cleanup") return true;
|
|
277
279
|
if (aEffect == null || aEffect !== rEffect) return false;
|
|
278
280
|
const enclosingFunction = Traverse.findParent(rEntry.node, Check.isFunction);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "5.30.0-beta.
|
|
3
|
+
"version": "5.30.0-beta.6",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.30.0-beta.
|
|
41
|
-
"@eslint-react/core": "5.30.0-beta.
|
|
42
|
-
"@eslint-react/eslint": "5.30.0-beta.
|
|
43
|
-
"@eslint-react/shared": "5.30.0-beta.
|
|
44
|
-
"@eslint-react/var": "5.30.0-beta.
|
|
45
|
-
"@typescript-eslint/types": "^8.72.
|
|
46
|
-
"@typescript-eslint/utils": "^8.72.
|
|
40
|
+
"@eslint-react/ast": "5.30.0-beta.6",
|
|
41
|
+
"@eslint-react/core": "5.30.0-beta.6",
|
|
42
|
+
"@eslint-react/eslint": "5.30.0-beta.6",
|
|
43
|
+
"@eslint-react/shared": "5.30.0-beta.6",
|
|
44
|
+
"@eslint-react/var": "5.30.0-beta.6",
|
|
45
|
+
"@typescript-eslint/types": "^8.72.1",
|
|
46
|
+
"@typescript-eslint/utils": "^8.72.1",
|
|
47
47
|
"ts-pattern": "^5.9.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|