eslint-plugin-react-web-api 1.24.0-next.0 → 1.24.0-next.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 +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -34,7 +34,7 @@ var VAR2__namespace = /*#__PURE__*/_interopNamespace(VAR2);
|
|
|
34
34
|
|
|
35
35
|
// package.json
|
|
36
36
|
var name = "eslint-plugin-react-web-api";
|
|
37
|
-
var version = "1.24.0-next.
|
|
37
|
+
var version = "1.24.0-next.2";
|
|
38
38
|
var createRule = shared.createRuleForPlugin("web-api");
|
|
39
39
|
function getInstanceID(node, prev) {
|
|
40
40
|
switch (true) {
|
|
@@ -84,7 +84,7 @@ function getFunctionKind(node) {
|
|
|
84
84
|
return getPhaseKindOfFunction(node) ?? "other";
|
|
85
85
|
}
|
|
86
86
|
function getSignalValueExpression(node, initialScope) {
|
|
87
|
-
if (node
|
|
87
|
+
if (node == null) return eff._;
|
|
88
88
|
switch (node.type) {
|
|
89
89
|
case utils.AST_NODE_TYPES.Identifier: {
|
|
90
90
|
return getSignalValueExpression(VAR2__namespace.getVariableNode(VAR2__namespace.findVariable(node, initialScope), 0), initialScope);
|
|
@@ -99,7 +99,7 @@ function getOptions(node, initialScope) {
|
|
|
99
99
|
function findProp(properties, propName) {
|
|
100
100
|
return JSX__namespace.findPropInProperties(propName, properties, initialScope);
|
|
101
101
|
}
|
|
102
|
-
function getPropValue(prop, filter = (
|
|
102
|
+
function getPropValue(prop, filter = (a) => true) {
|
|
103
103
|
if (prop?.type !== utils.AST_NODE_TYPES.Property) return eff._;
|
|
104
104
|
const { value } = prop;
|
|
105
105
|
let v = value;
|
|
@@ -193,7 +193,7 @@ var no_leaked_event_listener_default = createRule({
|
|
|
193
193
|
if (!AST2__namespace.isFunction(listener)) {
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
|
-
if (options.signal
|
|
196
|
+
if (options.signal != null) {
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
199
|
context.report({
|
|
@@ -212,7 +212,7 @@ var no_leaked_event_listener_default = createRule({
|
|
|
212
212
|
},
|
|
213
213
|
["CallExpression"](node) {
|
|
214
214
|
const fKind = fEntries.findLast((x) => x.kind !== "other")?.kind;
|
|
215
|
-
if (fKind
|
|
215
|
+
if (fKind == null) {
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
if (!core.ERPhaseRelevance.has(fKind)) {
|
|
@@ -259,7 +259,7 @@ var no_leaked_event_listener_default = createRule({
|
|
|
259
259
|
["Program:exit"]() {
|
|
260
260
|
for (const aEntry of aEntries) {
|
|
261
261
|
const signal = aEntry.signal;
|
|
262
|
-
if (signal
|
|
262
|
+
if (signal != null && abortedSignals.some((a) => isSameObject(a, signal))) {
|
|
263
263
|
continue;
|
|
264
264
|
}
|
|
265
265
|
if (rEntries.some((rEntry) => isInverseEntry(aEntry, rEntry))) {
|
|
@@ -341,7 +341,7 @@ var no_leaked_interval_default = createRule({
|
|
|
341
341
|
switch (getCallKind2(node)) {
|
|
342
342
|
case "setInterval": {
|
|
343
343
|
const fEntry = fEntries.findLast((x) => x.kind !== "other");
|
|
344
|
-
if (fEntry
|
|
344
|
+
if (fEntry == null) {
|
|
345
345
|
break;
|
|
346
346
|
}
|
|
347
347
|
if (!core.ERPhaseRelevance.has(fEntry.kind)) {
|
|
@@ -366,7 +366,7 @@ var no_leaked_interval_default = createRule({
|
|
|
366
366
|
}
|
|
367
367
|
case "clearInterval": {
|
|
368
368
|
const fEntry = fEntries.findLast((x) => x.kind !== "other");
|
|
369
|
-
if (fEntry
|
|
369
|
+
if (fEntry == null) {
|
|
370
370
|
break;
|
|
371
371
|
}
|
|
372
372
|
if (!core.ERPhaseRelevance.has(fEntry.kind)) {
|
|
@@ -490,7 +490,7 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
490
490
|
return;
|
|
491
491
|
}
|
|
492
492
|
const fKind = fEntries.findLast((x) => x.kind !== "other")?.kind;
|
|
493
|
-
if (fKind
|
|
493
|
+
if (fKind == null || !core.ERPhaseRelevance.has(fKind)) {
|
|
494
494
|
return;
|
|
495
495
|
}
|
|
496
496
|
const { object } = node.callee;
|
|
@@ -535,7 +535,7 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
535
535
|
},
|
|
536
536
|
["NewExpression"](node) {
|
|
537
537
|
const fEntry = fEntries.findLast((x) => x.kind !== "other");
|
|
538
|
-
if (fEntry
|
|
538
|
+
if (fEntry == null) return;
|
|
539
539
|
if (!core.ERPhaseRelevance.has(fEntry.kind)) {
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
@@ -543,7 +543,7 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
543
543
|
return;
|
|
544
544
|
}
|
|
545
545
|
const id = getInstanceID(node);
|
|
546
|
-
if (id
|
|
546
|
+
if (id == null) {
|
|
547
547
|
context.report({
|
|
548
548
|
messageId: "noLeakedResizeObserverNoFloatingInstance",
|
|
549
549
|
node
|
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from '@typescript-eslint/types';
|
|
|
10
10
|
|
|
11
11
|
// package.json
|
|
12
12
|
var name = "eslint-plugin-react-web-api";
|
|
13
|
-
var version = "1.24.0-next.
|
|
13
|
+
var version = "1.24.0-next.2";
|
|
14
14
|
var createRule = createRuleForPlugin("web-api");
|
|
15
15
|
function getInstanceID(node, prev) {
|
|
16
16
|
switch (true) {
|
|
@@ -60,7 +60,7 @@ function getFunctionKind(node) {
|
|
|
60
60
|
return getPhaseKindOfFunction(node) ?? "other";
|
|
61
61
|
}
|
|
62
62
|
function getSignalValueExpression(node, initialScope) {
|
|
63
|
-
if (node
|
|
63
|
+
if (node == null) return _;
|
|
64
64
|
switch (node.type) {
|
|
65
65
|
case AST_NODE_TYPES.Identifier: {
|
|
66
66
|
return getSignalValueExpression(VAR2.getVariableNode(VAR2.findVariable(node, initialScope), 0), initialScope);
|
|
@@ -75,7 +75,7 @@ function getOptions(node, initialScope) {
|
|
|
75
75
|
function findProp(properties, propName) {
|
|
76
76
|
return JSX.findPropInProperties(propName, properties, initialScope);
|
|
77
77
|
}
|
|
78
|
-
function getPropValue(prop, filter = (
|
|
78
|
+
function getPropValue(prop, filter = (a) => true) {
|
|
79
79
|
if (prop?.type !== AST_NODE_TYPES.Property) return _;
|
|
80
80
|
const { value } = prop;
|
|
81
81
|
let v = value;
|
|
@@ -169,7 +169,7 @@ var no_leaked_event_listener_default = createRule({
|
|
|
169
169
|
if (!AST2.isFunction(listener)) {
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
if (options.signal
|
|
172
|
+
if (options.signal != null) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
175
|
context.report({
|
|
@@ -188,7 +188,7 @@ var no_leaked_event_listener_default = createRule({
|
|
|
188
188
|
},
|
|
189
189
|
["CallExpression"](node) {
|
|
190
190
|
const fKind = fEntries.findLast((x) => x.kind !== "other")?.kind;
|
|
191
|
-
if (fKind
|
|
191
|
+
if (fKind == null) {
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
if (!ERPhaseRelevance.has(fKind)) {
|
|
@@ -235,7 +235,7 @@ var no_leaked_event_listener_default = createRule({
|
|
|
235
235
|
["Program:exit"]() {
|
|
236
236
|
for (const aEntry of aEntries) {
|
|
237
237
|
const signal = aEntry.signal;
|
|
238
|
-
if (signal
|
|
238
|
+
if (signal != null && abortedSignals.some((a) => isSameObject(a, signal))) {
|
|
239
239
|
continue;
|
|
240
240
|
}
|
|
241
241
|
if (rEntries.some((rEntry) => isInverseEntry(aEntry, rEntry))) {
|
|
@@ -317,7 +317,7 @@ var no_leaked_interval_default = createRule({
|
|
|
317
317
|
switch (getCallKind2(node)) {
|
|
318
318
|
case "setInterval": {
|
|
319
319
|
const fEntry = fEntries.findLast((x) => x.kind !== "other");
|
|
320
|
-
if (fEntry
|
|
320
|
+
if (fEntry == null) {
|
|
321
321
|
break;
|
|
322
322
|
}
|
|
323
323
|
if (!ERPhaseRelevance.has(fEntry.kind)) {
|
|
@@ -342,7 +342,7 @@ var no_leaked_interval_default = createRule({
|
|
|
342
342
|
}
|
|
343
343
|
case "clearInterval": {
|
|
344
344
|
const fEntry = fEntries.findLast((x) => x.kind !== "other");
|
|
345
|
-
if (fEntry
|
|
345
|
+
if (fEntry == null) {
|
|
346
346
|
break;
|
|
347
347
|
}
|
|
348
348
|
if (!ERPhaseRelevance.has(fEntry.kind)) {
|
|
@@ -466,7 +466,7 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
466
466
|
return;
|
|
467
467
|
}
|
|
468
468
|
const fKind = fEntries.findLast((x) => x.kind !== "other")?.kind;
|
|
469
|
-
if (fKind
|
|
469
|
+
if (fKind == null || !ERPhaseRelevance.has(fKind)) {
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
472
472
|
const { object } = node.callee;
|
|
@@ -511,7 +511,7 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
511
511
|
},
|
|
512
512
|
["NewExpression"](node) {
|
|
513
513
|
const fEntry = fEntries.findLast((x) => x.kind !== "other");
|
|
514
|
-
if (fEntry
|
|
514
|
+
if (fEntry == null) return;
|
|
515
515
|
if (!ERPhaseRelevance.has(fEntry.kind)) {
|
|
516
516
|
return;
|
|
517
517
|
}
|
|
@@ -519,7 +519,7 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
519
519
|
return;
|
|
520
520
|
}
|
|
521
521
|
const id = getInstanceID(node);
|
|
522
|
-
if (id
|
|
522
|
+
if (id == null) {
|
|
523
523
|
context.report({
|
|
524
524
|
messageId: "noLeakedResizeObserverNoFloatingInstance",
|
|
525
525
|
node
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "1.24.0-next.
|
|
3
|
+
"version": "1.24.0-next.2",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"@typescript-eslint/utils": "^8.19.1",
|
|
47
47
|
"string-ts": "^2.2.0",
|
|
48
48
|
"ts-pattern": "^5.6.0",
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/eff": "1.24.0-next.
|
|
51
|
-
"@eslint-react/jsx": "1.24.0-next.
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/types": "1.24.0-next.
|
|
55
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "1.24.0-next.2",
|
|
50
|
+
"@eslint-react/eff": "1.24.0-next.2",
|
|
51
|
+
"@eslint-react/jsx": "1.24.0-next.2",
|
|
52
|
+
"@eslint-react/core": "1.24.0-next.2",
|
|
53
|
+
"@eslint-react/shared": "1.24.0-next.2",
|
|
54
|
+
"@eslint-react/types": "1.24.0-next.2",
|
|
55
|
+
"@eslint-react/var": "1.24.0-next.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@types/react": "^19.0.
|
|
59
|
-
"@types/react-dom": "^19.0.
|
|
58
|
+
"@types/react": "^19.0.6",
|
|
59
|
+
"@types/react-dom": "^19.0.3",
|
|
60
60
|
"tsup": "^8.3.5",
|
|
61
61
|
"@workspace/configs": "0.0.0"
|
|
62
62
|
},
|