eslint-plugin-react-web-api 5.30.3 → 5.30.5
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 +9 -5
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Check, Compare, Extract, Traverse } from "@eslint-react/ast";
|
|
|
5
5
|
import { getFunctionId, isUseEffectCleanupCallback, isUseEffectSetupCallback, isUseRefLikeCall } from "@eslint-react/core";
|
|
6
6
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
7
7
|
import { P, isMatching, match } from "ts-pattern";
|
|
8
|
-
import { isAssignmentTargetEqual, isInitializedFromReactNative, isProvenanceEqual, resolve, resolveEnclosingAssignmentTarget, resolveOrigin } from "@eslint-react/var";
|
|
8
|
+
import { isAssignmentTargetEqual, isInitializedFromReactNative, isProvenanceEqual, resolve, resolveEnclosingAssignmentTarget, resolveOrigin, resolveOriginChain } from "@eslint-react/var";
|
|
9
9
|
import { findVariable, getStaticValue } from "@typescript-eslint/utils/ast-utils";
|
|
10
10
|
// \0rolldown/runtime.js
|
|
11
11
|
var __defProp = Object.defineProperty;
|
|
@@ -20,7 +20,7 @@ var __exportAll = (all, flags) => {
|
|
|
20
20
|
};
|
|
21
21
|
// package.json
|
|
22
22
|
var name$1 = "eslint-plugin-react-web-api";
|
|
23
|
-
var version = "5.30.
|
|
23
|
+
var version = "5.30.5";
|
|
24
24
|
// src/utils/create-rule.ts
|
|
25
25
|
function getDocsUrl(ruleName) {
|
|
26
26
|
return `https://eslint-react.xyz/docs/rules/web-api-${ruleName}`;
|
|
@@ -292,6 +292,11 @@ function isSignalPropertyBinding(context, node) {
|
|
|
292
292
|
}
|
|
293
293
|
return false;
|
|
294
294
|
}
|
|
295
|
+
function isAbortControllerNew(node) {
|
|
296
|
+
if (node?.type !== AST_NODE_TYPES.NewExpression) return false;
|
|
297
|
+
const callee = Extract.unwrap(node.callee);
|
|
298
|
+
return callee.type === AST_NODE_TYPES.Identifier && callee.name === "AbortController";
|
|
299
|
+
}
|
|
295
300
|
function getSignalValueExpression({ context, node }) {
|
|
296
301
|
const seen = /* @__PURE__ */ new Set();
|
|
297
302
|
function visit(node) {
|
|
@@ -303,9 +308,8 @@ function getSignalValueExpression({ context, node }) {
|
|
|
303
308
|
const resolved = resolveOrigin(context, node);
|
|
304
309
|
const unwrapped = resolved == null ? null : Extract.unwrap(resolved);
|
|
305
310
|
if (unwrapped != null && Check.isFunction(unwrapped)) return node;
|
|
306
|
-
if (unwrapped != null &&
|
|
307
|
-
|
|
308
|
-
if (newCallee.type === AST_NODE_TYPES.Identifier && newCallee.name === "AbortController") return node;
|
|
311
|
+
if (unwrapped != null && isSignalPropertyBinding(context, node)) {
|
|
312
|
+
if (isAbortControllerNew(unwrapped.type === AST_NODE_TYPES.Identifier ? resolveOriginChain(context, unwrapped) : unwrapped)) return node;
|
|
309
313
|
}
|
|
310
314
|
return visit(unwrapped);
|
|
311
315
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "5.30.
|
|
3
|
+
"version": "5.30.5",
|
|
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.
|
|
41
|
-
"@eslint-react/core": "5.30.
|
|
42
|
-
"@eslint-react/eslint": "5.30.
|
|
43
|
-
"@eslint-react/shared": "5.30.
|
|
44
|
-
"@eslint-react/var": "5.30.
|
|
45
|
-
"@typescript-eslint/types": "^8.
|
|
46
|
-
"@typescript-eslint/utils": "^8.
|
|
40
|
+
"@eslint-react/ast": "5.30.5",
|
|
41
|
+
"@eslint-react/core": "5.30.5",
|
|
42
|
+
"@eslint-react/eslint": "5.30.5",
|
|
43
|
+
"@eslint-react/shared": "5.30.5",
|
|
44
|
+
"@eslint-react/var": "5.30.5",
|
|
45
|
+
"@typescript-eslint/types": "^8.73.0",
|
|
46
|
+
"@typescript-eslint/utils": "^8.73.0",
|
|
47
47
|
"ts-pattern": "^5.9.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|