eslint-plugin-react-web-api 5.24.2 → 5.24.4
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 +18 -45
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -7,35 +7,27 @@ import { isAssignmentTargetEqual, isInitializedFromReactNative, isValueEqual, re
|
|
|
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";
|
|
10
|
-
|
|
11
10
|
//#region \0rolldown/runtime.js
|
|
12
11
|
var __defProp = Object.defineProperty;
|
|
13
12
|
var __exportAll = (all, no_symbols) => {
|
|
14
13
|
let target = {};
|
|
15
|
-
for (var name in all) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
if (!no_symbols) {
|
|
22
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
23
|
-
}
|
|
14
|
+
for (var name in all) __defProp(target, name, {
|
|
15
|
+
get: all[name],
|
|
16
|
+
enumerable: true
|
|
17
|
+
});
|
|
18
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
24
19
|
return target;
|
|
25
20
|
};
|
|
26
|
-
|
|
27
21
|
//#endregion
|
|
28
22
|
//#region package.json
|
|
29
23
|
var name$1 = "eslint-plugin-react-web-api";
|
|
30
|
-
var version = "5.24.
|
|
31
|
-
|
|
24
|
+
var version = "5.24.4";
|
|
32
25
|
//#endregion
|
|
33
26
|
//#region src/utils/create-rule.ts
|
|
34
27
|
function getDocsUrl(ruleName) {
|
|
35
28
|
return `https://eslint-react.xyz/docs/rules/web-api-${ruleName}`;
|
|
36
29
|
}
|
|
37
30
|
const createRule = ESLintUtils.RuleCreator(getDocsUrl);
|
|
38
|
-
|
|
39
31
|
//#endregion
|
|
40
32
|
//#region ../../.pkgs/eff/dist/index.js
|
|
41
33
|
const pipeArguments = (self, args) => {
|
|
@@ -60,7 +52,7 @@ const pipeArguments = (self, args) => {
|
|
|
60
52
|
const Prototype = { pipe() {
|
|
61
53
|
return pipeArguments(this, arguments);
|
|
62
54
|
} };
|
|
63
|
-
|
|
55
|
+
(function() {
|
|
64
56
|
function PipeableBase() {}
|
|
65
57
|
PipeableBase.prototype = Prototype;
|
|
66
58
|
return PipeableBase;
|
|
@@ -95,23 +87,18 @@ const dual = function(arity, body) {
|
|
|
95
87
|
};
|
|
96
88
|
const identity = (a) => a;
|
|
97
89
|
const cast = identity;
|
|
98
|
-
|
|
99
|
-
const constTrue = constant(true);
|
|
100
|
-
const constFalse = constant(false);
|
|
101
|
-
const constNull = constant(null);
|
|
102
|
-
const constUndefined = constant(void 0);
|
|
103
|
-
const compose = dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
90
|
+
dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
104
91
|
const absurd = (_) => {
|
|
105
92
|
throw new Error("Called `absurd` function which should be uncallable");
|
|
106
93
|
};
|
|
107
|
-
|
|
94
|
+
cast(absurd);
|
|
108
95
|
const and = dual(2, (a, b) => (data) => a(data) && b(data));
|
|
109
96
|
const or = dual(2, (a, b) => (data) => a(data) || b(data));
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
97
|
+
dual(2, (a, b) => (data) => a(data) !== b(data));
|
|
98
|
+
dual(2, (a, b) => (data) => a(data) === b(data));
|
|
99
|
+
dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
|
|
100
|
+
dual(2, (a, b) => (data) => !a(data) && !b(data));
|
|
101
|
+
dual(2, (a, b) => (data) => !a(data) || !b(data));
|
|
115
102
|
function isString(input) {
|
|
116
103
|
return typeof input === "string";
|
|
117
104
|
}
|
|
@@ -121,28 +108,27 @@ function isFunction(input) {
|
|
|
121
108
|
function isObjectKeyword(input) {
|
|
122
109
|
return typeof input === "object" && input !== null || isFunction(input);
|
|
123
110
|
}
|
|
124
|
-
|
|
111
|
+
dual(2, (data, property) => isObjectKeyword(data) && property in data);
|
|
125
112
|
function getOrInsertComputed(map, key, callback) {
|
|
126
113
|
if (map.has(key)) return map.get(key);
|
|
127
114
|
const value = callback(key);
|
|
128
115
|
map.set(key, value);
|
|
129
116
|
return value;
|
|
130
117
|
}
|
|
131
|
-
|
|
118
|
+
dual(2, (self, predicate) => {
|
|
132
119
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
133
120
|
const len = input.length;
|
|
134
121
|
let idx = 0;
|
|
135
122
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
136
123
|
return input.slice(idx);
|
|
137
124
|
});
|
|
138
|
-
|
|
125
|
+
dual(2, (self, predicate) => {
|
|
139
126
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
140
127
|
const len = input.length;
|
|
141
128
|
let idx = 0;
|
|
142
129
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
143
130
|
return input.slice(0, idx);
|
|
144
131
|
});
|
|
145
|
-
|
|
146
132
|
//#endregion
|
|
147
133
|
//#region src/rules/no-leaked-event-listener/lib.ts
|
|
148
134
|
function getSignalValueExpression(context, node) {
|
|
@@ -194,7 +180,6 @@ function getOptions(context, node) {
|
|
|
194
180
|
}
|
|
195
181
|
return visit(node);
|
|
196
182
|
}
|
|
197
|
-
|
|
198
183
|
//#endregion
|
|
199
184
|
//#region src/rules/no-leaked-event-listener/no-leaked-event-listener.ts
|
|
200
185
|
const RULE_NAME$5 = "no-leaked-event-listener";
|
|
@@ -357,7 +342,6 @@ function create$5(context) {
|
|
|
357
342
|
}
|
|
358
343
|
};
|
|
359
344
|
}
|
|
360
|
-
|
|
361
345
|
//#endregion
|
|
362
346
|
//#region src/rules/no-leaked-fetch/lib.ts
|
|
363
347
|
function resolveToObjectExpression(context, node) {
|
|
@@ -373,7 +357,6 @@ function resolveToObjectExpression(context, node) {
|
|
|
373
357
|
default: return null;
|
|
374
358
|
}
|
|
375
359
|
}
|
|
376
|
-
|
|
377
360
|
//#endregion
|
|
378
361
|
//#region src/rules/no-leaked-fetch/no-leaked-fetch.ts
|
|
379
362
|
const RULE_NAME$4 = "no-leaked-fetch";
|
|
@@ -495,7 +478,6 @@ function create$4(context) {
|
|
|
495
478
|
}
|
|
496
479
|
};
|
|
497
480
|
}
|
|
498
|
-
|
|
499
481
|
//#endregion
|
|
500
482
|
//#region src/rules/no-leaked-intersection-observer/lib.ts
|
|
501
483
|
function isNewObserver$1(node, name) {
|
|
@@ -513,7 +495,6 @@ function isFromObserver$1(context, node, name) {
|
|
|
513
495
|
default: return false;
|
|
514
496
|
}
|
|
515
497
|
}
|
|
516
|
-
|
|
517
498
|
//#endregion
|
|
518
499
|
//#region src/rules/no-leaked-intersection-observer/no-leaked-intersection-observer.ts
|
|
519
500
|
const RULE_NAME$3 = "no-leaked-intersection-observer";
|
|
@@ -622,7 +603,6 @@ function create$3(context) {
|
|
|
622
603
|
}
|
|
623
604
|
};
|
|
624
605
|
}
|
|
625
|
-
|
|
626
606
|
//#endregion
|
|
627
607
|
//#region src/rules/no-leaked-interval/no-leaked-interval.ts
|
|
628
608
|
const RULE_NAME$2 = "no-leaked-interval";
|
|
@@ -690,7 +670,6 @@ function create$2(context) {
|
|
|
690
670
|
}
|
|
691
671
|
};
|
|
692
672
|
}
|
|
693
|
-
|
|
694
673
|
//#endregion
|
|
695
674
|
//#region src/rules/no-leaked-resize-observer/lib.ts
|
|
696
675
|
function isNewObserver(node, name) {
|
|
@@ -708,7 +687,6 @@ function isFromObserver(context, node, name) {
|
|
|
708
687
|
default: return false;
|
|
709
688
|
}
|
|
710
689
|
}
|
|
711
|
-
|
|
712
690
|
//#endregion
|
|
713
691
|
//#region src/rules/no-leaked-resize-observer/no-leaked-resize-observer.ts
|
|
714
692
|
const RULE_NAME$1 = "no-leaked-resize-observer";
|
|
@@ -817,7 +795,6 @@ function create$1(context) {
|
|
|
817
795
|
}
|
|
818
796
|
};
|
|
819
797
|
}
|
|
820
|
-
|
|
821
798
|
//#endregion
|
|
822
799
|
//#region src/rules/no-leaked-timeout/no-leaked-timeout.ts
|
|
823
800
|
const RULE_NAME = "no-leaked-timeout";
|
|
@@ -885,7 +862,6 @@ function create(context) {
|
|
|
885
862
|
}
|
|
886
863
|
};
|
|
887
864
|
}
|
|
888
|
-
|
|
889
865
|
//#endregion
|
|
890
866
|
//#region src/plugin.ts
|
|
891
867
|
const plugin = {
|
|
@@ -902,7 +878,6 @@ const plugin = {
|
|
|
902
878
|
"no-leaked-timeout": no_leaked_timeout_default
|
|
903
879
|
}
|
|
904
880
|
};
|
|
905
|
-
|
|
906
881
|
//#endregion
|
|
907
882
|
//#region src/configs/recommended.ts
|
|
908
883
|
var recommended_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -922,7 +897,6 @@ const rules = {
|
|
|
922
897
|
};
|
|
923
898
|
const plugins = { "react-web-api": plugin };
|
|
924
899
|
const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
925
|
-
|
|
926
900
|
//#endregion
|
|
927
901
|
//#region src/index.ts
|
|
928
902
|
function createConfig(base) {
|
|
@@ -940,6 +914,5 @@ const finalPlugin = {
|
|
|
940
914
|
...plugin,
|
|
941
915
|
configs: { ["recommended"]: createConfig(recommended_exports) }
|
|
942
916
|
};
|
|
943
|
-
|
|
944
917
|
//#endregion
|
|
945
|
-
export { finalPlugin as default };
|
|
918
|
+
export { finalPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "5.24.
|
|
3
|
+
"version": "5.24.4",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@eslint-react/ast": "5.24.
|
|
41
|
-
"@eslint-react/core": "5.24.
|
|
42
|
-
"@eslint-react/eslint": "5.24.
|
|
43
|
-
"@eslint-react/shared": "5.24.
|
|
44
|
-
"@eslint-react/var": "5.24.
|
|
40
|
+
"@eslint-react/ast": "5.24.4",
|
|
41
|
+
"@eslint-react/core": "5.24.4",
|
|
42
|
+
"@eslint-react/eslint": "5.24.4",
|
|
43
|
+
"@eslint-react/shared": "5.24.4",
|
|
44
|
+
"@eslint-react/var": "5.24.4",
|
|
45
45
|
"@typescript-eslint/types": "^8.71.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.71.0",
|
|
47
47
|
"ts-pattern": "^5.9.0"
|