eslint-plugin-react-web-api 1.23.1-next.4 → 1.23.1-next.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 +33 -36
- package/dist/index.mjs +34 -37
- package/package.json +8 -8
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.23.1-next.
|
|
37
|
+
var version = "1.23.1-next.6";
|
|
38
38
|
var createRule = shared.createRuleForPlugin("web-api");
|
|
39
39
|
function getInstanceID(node, prev) {
|
|
40
40
|
switch (true) {
|
|
@@ -59,8 +59,6 @@ function isInstanceIDEqual(a, b, context) {
|
|
|
59
59
|
context.sourceCode.getScope(b)
|
|
60
60
|
]);
|
|
61
61
|
}
|
|
62
|
-
var EventListenerEntry = eff.Data.taggedEnum();
|
|
63
|
-
var ObserverEntry = eff.Data.taggedEnum();
|
|
64
62
|
|
|
65
63
|
// src/rules/no-leaked-event-listener.ts
|
|
66
64
|
var RULE_NAME = "no-leaked-event-listener";
|
|
@@ -217,28 +215,30 @@ var no_leaked_event_listener_default = createRule({
|
|
|
217
215
|
const opts = options ? getOptions(options, context.sourceCode.getScope(options)) : defaultOptions;
|
|
218
216
|
const { callee } = node;
|
|
219
217
|
eff.O.map(checkInlineFunction(node, callKind, opts), context.report);
|
|
220
|
-
aEntries.push(
|
|
218
|
+
aEntries.push({
|
|
221
219
|
...opts,
|
|
220
|
+
kind: "addEventListener",
|
|
222
221
|
type,
|
|
223
222
|
node,
|
|
224
223
|
callee,
|
|
225
224
|
listener,
|
|
226
225
|
phase: fKind
|
|
227
|
-
})
|
|
226
|
+
});
|
|
228
227
|
}).with("removeEventListener", (callKind) => {
|
|
229
228
|
const [type, listener, options] = node.arguments;
|
|
230
229
|
if (!type || !listener) return;
|
|
231
230
|
const opts = options ? getOptions(options, context.sourceCode.getScope(options)) : defaultOptions;
|
|
232
231
|
const { callee } = node;
|
|
233
232
|
eff.O.map(checkInlineFunction(node, callKind, opts), context.report);
|
|
234
|
-
rEntries.push(
|
|
233
|
+
rEntries.push({
|
|
235
234
|
...opts,
|
|
235
|
+
kind: "removeEventListener",
|
|
236
236
|
type,
|
|
237
237
|
node,
|
|
238
238
|
callee,
|
|
239
239
|
listener,
|
|
240
240
|
phase: fKind
|
|
241
|
-
})
|
|
241
|
+
});
|
|
242
242
|
}).with("abort", () => {
|
|
243
243
|
abortedSignals.push(node.callee);
|
|
244
244
|
}).otherwise(eff.F.constVoid);
|
|
@@ -458,41 +458,38 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
458
458
|
if (!core.ERPhaseRelevance.has(fKind)) return;
|
|
459
459
|
const { object } = node.callee;
|
|
460
460
|
tsPattern.match(getCallKind3(node, context)).with("disconnect", () => {
|
|
461
|
-
dEntries.push(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
);
|
|
461
|
+
dEntries.push({
|
|
462
|
+
kind: "disconnect",
|
|
463
|
+
node,
|
|
464
|
+
callee: node.callee,
|
|
465
|
+
observer: object,
|
|
466
|
+
observerKind: "ResizeObserver",
|
|
467
|
+
phase: fKind
|
|
468
|
+
});
|
|
470
469
|
}).with("observe", () => {
|
|
471
470
|
const [element] = node.arguments;
|
|
472
471
|
if (!element) return;
|
|
473
|
-
oEntries.push(
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
);
|
|
472
|
+
oEntries.push({
|
|
473
|
+
kind: "observe",
|
|
474
|
+
node,
|
|
475
|
+
callee: node.callee,
|
|
476
|
+
element,
|
|
477
|
+
observer: object,
|
|
478
|
+
observerKind: "ResizeObserver",
|
|
479
|
+
phase: fKind
|
|
480
|
+
});
|
|
483
481
|
}).with("unobserve", () => {
|
|
484
482
|
const [element] = node.arguments;
|
|
485
483
|
if (!element) return;
|
|
486
|
-
uEntries.push(
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
);
|
|
484
|
+
uEntries.push({
|
|
485
|
+
kind: "unobserve",
|
|
486
|
+
node,
|
|
487
|
+
callee: node.callee,
|
|
488
|
+
element,
|
|
489
|
+
observer: object,
|
|
490
|
+
observerKind: "ResizeObserver",
|
|
491
|
+
phase: fKind
|
|
492
|
+
});
|
|
496
493
|
}).otherwise(eff.F.constVoid);
|
|
497
494
|
},
|
|
498
495
|
["NewExpression"](node) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as AST2 from '@eslint-react/ast';
|
|
2
2
|
import { ERPhaseRelevance, isSetupFunction, isCleanupFunction, isComponentDidMountFunction, isComponentWillUnmountFunction, isInversePhase } from '@eslint-react/core';
|
|
3
|
-
import {
|
|
3
|
+
import { O, F, or, not, isBoolean } from '@eslint-react/eff';
|
|
4
4
|
import * as JSX from '@eslint-react/jsx';
|
|
5
5
|
import * as VAR2 from '@eslint-react/var';
|
|
6
6
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
@@ -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.23.1-next.
|
|
13
|
+
var version = "1.23.1-next.6";
|
|
14
14
|
var createRule = createRuleForPlugin("web-api");
|
|
15
15
|
function getInstanceID(node, prev) {
|
|
16
16
|
switch (true) {
|
|
@@ -35,8 +35,6 @@ function isInstanceIDEqual(a, b, context) {
|
|
|
35
35
|
context.sourceCode.getScope(b)
|
|
36
36
|
]);
|
|
37
37
|
}
|
|
38
|
-
var EventListenerEntry = Data.taggedEnum();
|
|
39
|
-
var ObserverEntry = Data.taggedEnum();
|
|
40
38
|
|
|
41
39
|
// src/rules/no-leaked-event-listener.ts
|
|
42
40
|
var RULE_NAME = "no-leaked-event-listener";
|
|
@@ -193,28 +191,30 @@ var no_leaked_event_listener_default = createRule({
|
|
|
193
191
|
const opts = options ? getOptions(options, context.sourceCode.getScope(options)) : defaultOptions;
|
|
194
192
|
const { callee } = node;
|
|
195
193
|
O.map(checkInlineFunction(node, callKind, opts), context.report);
|
|
196
|
-
aEntries.push(
|
|
194
|
+
aEntries.push({
|
|
197
195
|
...opts,
|
|
196
|
+
kind: "addEventListener",
|
|
198
197
|
type,
|
|
199
198
|
node,
|
|
200
199
|
callee,
|
|
201
200
|
listener,
|
|
202
201
|
phase: fKind
|
|
203
|
-
})
|
|
202
|
+
});
|
|
204
203
|
}).with("removeEventListener", (callKind) => {
|
|
205
204
|
const [type, listener, options] = node.arguments;
|
|
206
205
|
if (!type || !listener) return;
|
|
207
206
|
const opts = options ? getOptions(options, context.sourceCode.getScope(options)) : defaultOptions;
|
|
208
207
|
const { callee } = node;
|
|
209
208
|
O.map(checkInlineFunction(node, callKind, opts), context.report);
|
|
210
|
-
rEntries.push(
|
|
209
|
+
rEntries.push({
|
|
211
210
|
...opts,
|
|
211
|
+
kind: "removeEventListener",
|
|
212
212
|
type,
|
|
213
213
|
node,
|
|
214
214
|
callee,
|
|
215
215
|
listener,
|
|
216
216
|
phase: fKind
|
|
217
|
-
})
|
|
217
|
+
});
|
|
218
218
|
}).with("abort", () => {
|
|
219
219
|
abortedSignals.push(node.callee);
|
|
220
220
|
}).otherwise(F.constVoid);
|
|
@@ -434,41 +434,38 @@ var no_leaked_resize_observer_default = createRule({
|
|
|
434
434
|
if (!ERPhaseRelevance.has(fKind)) return;
|
|
435
435
|
const { object } = node.callee;
|
|
436
436
|
match(getCallKind3(node, context)).with("disconnect", () => {
|
|
437
|
-
dEntries.push(
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
);
|
|
437
|
+
dEntries.push({
|
|
438
|
+
kind: "disconnect",
|
|
439
|
+
node,
|
|
440
|
+
callee: node.callee,
|
|
441
|
+
observer: object,
|
|
442
|
+
observerKind: "ResizeObserver",
|
|
443
|
+
phase: fKind
|
|
444
|
+
});
|
|
446
445
|
}).with("observe", () => {
|
|
447
446
|
const [element] = node.arguments;
|
|
448
447
|
if (!element) return;
|
|
449
|
-
oEntries.push(
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
);
|
|
448
|
+
oEntries.push({
|
|
449
|
+
kind: "observe",
|
|
450
|
+
node,
|
|
451
|
+
callee: node.callee,
|
|
452
|
+
element,
|
|
453
|
+
observer: object,
|
|
454
|
+
observerKind: "ResizeObserver",
|
|
455
|
+
phase: fKind
|
|
456
|
+
});
|
|
459
457
|
}).with("unobserve", () => {
|
|
460
458
|
const [element] = node.arguments;
|
|
461
459
|
if (!element) return;
|
|
462
|
-
uEntries.push(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
);
|
|
460
|
+
uEntries.push({
|
|
461
|
+
kind: "unobserve",
|
|
462
|
+
node,
|
|
463
|
+
callee: node.callee,
|
|
464
|
+
element,
|
|
465
|
+
observer: object,
|
|
466
|
+
observerKind: "ResizeObserver",
|
|
467
|
+
phase: fKind
|
|
468
|
+
});
|
|
472
469
|
}).otherwise(F.constVoid);
|
|
473
470
|
},
|
|
474
471
|
["NewExpression"](node) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "1.23.1-next.
|
|
3
|
+
"version": "1.23.1-next.6",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"@typescript-eslint/utils": "^8.19.0",
|
|
47
47
|
"string-ts": "^2.2.0",
|
|
48
48
|
"ts-pattern": "^5.6.0",
|
|
49
|
-
"@eslint-react/ast": "1.23.1-next.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/jsx": "1.23.1-next.
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "1.23.1-next.6",
|
|
50
|
+
"@eslint-react/eff": "1.23.1-next.6",
|
|
51
|
+
"@eslint-react/jsx": "1.23.1-next.6",
|
|
52
|
+
"@eslint-react/shared": "1.23.1-next.6",
|
|
53
|
+
"@eslint-react/types": "1.23.1-next.6",
|
|
54
|
+
"@eslint-react/core": "1.23.1-next.6",
|
|
55
|
+
"@eslint-react/var": "1.23.1-next.6"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/react": "^19.0.2",
|