eslint-plugin-react-web-api 2.0.2-next.2 → 2.0.2
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 +2 -8
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { findAssignmentTarget, findProperty, findVariable, getVariableDefinition
|
|
|
6
6
|
import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
|
|
7
7
|
import { getStaticValue } from "@typescript-eslint/utils/ast-utils";
|
|
8
8
|
import { P, isMatching, match } from "ts-pattern";
|
|
9
|
-
import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from "@typescript-eslint/types";
|
|
10
9
|
|
|
11
10
|
//#region rolldown:runtime
|
|
12
11
|
var __defProp = Object.defineProperty;
|
|
@@ -38,17 +37,12 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
38
37
|
//#endregion
|
|
39
38
|
//#region package.json
|
|
40
39
|
var name = "eslint-plugin-react-web-api";
|
|
41
|
-
var version = "2.0.2
|
|
40
|
+
var version = "2.0.2";
|
|
42
41
|
|
|
43
42
|
//#endregion
|
|
44
43
|
//#region src/utils/create-rule.ts
|
|
45
44
|
const createRule = ESLintUtils.RuleCreator(getDocsUrl("web-api"));
|
|
46
45
|
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/utils/is-conditional.ts
|
|
49
|
-
const isControlFlow = or(AST.isLoop, AST.isOneOf([AST_NODE_TYPES$1.IfStatement, AST_NODE_TYPES$1.SwitchStatement]));
|
|
50
|
-
const isConditional = or(isControlFlow, AST.isOneOf([AST_NODE_TYPES$1.LogicalExpression, AST_NODE_TYPES$1.ConditionalExpression]));
|
|
51
|
-
|
|
52
46
|
//#endregion
|
|
53
47
|
//#region src/rules/no-leaked-event-listener.ts
|
|
54
48
|
const RULE_NAME$3 = "no-leaked-event-listener";
|
|
@@ -486,7 +480,7 @@ function create$1(context) {
|
|
|
486
480
|
if (dEntries.some((e) => isInstanceIdEqual(context, e.observer, id))) continue;
|
|
487
481
|
const oentries = oEntries.filter((e) => isInstanceIdEqual(context, e.observer, id));
|
|
488
482
|
const uentries = uEntries.filter((e) => isInstanceIdEqual(context, e.observer, id));
|
|
489
|
-
const isDynamic = (node$1) => node$1?.type === AST_NODE_TYPES.CallExpression || isConditional(node$1);
|
|
483
|
+
const isDynamic = (node$1) => node$1?.type === AST_NODE_TYPES.CallExpression || AST.isConditional(node$1);
|
|
490
484
|
const isPhaseNode = (node$1) => node$1 === phaseNode;
|
|
491
485
|
if (oentries.some((e) => !isPhaseNode(AST.findParentNode(e.node, or(isDynamic, isPhaseNode))))) {
|
|
492
486
|
context.report({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "2.0.2
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@typescript-eslint/utils": "^8.44.1",
|
|
41
41
|
"string-ts": "^2.2.1",
|
|
42
42
|
"ts-pattern": "^5.8.0",
|
|
43
|
-
"@eslint-react/ast": "2.0.2
|
|
44
|
-
"@eslint-react/
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/shared": "2.0.2
|
|
47
|
-
"@eslint-react/var": "2.0.2
|
|
48
|
-
"@eslint-react/
|
|
43
|
+
"@eslint-react/ast": "2.0.2",
|
|
44
|
+
"@eslint-react/core": "2.0.2",
|
|
45
|
+
"@eslint-react/eff": "2.0.2",
|
|
46
|
+
"@eslint-react/shared": "2.0.2",
|
|
47
|
+
"@eslint-react/var": "2.0.2",
|
|
48
|
+
"@eslint-react/kit": "2.0.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/react": "^19.1.15",
|