eslint-plugin-react-web-api 1.24.0-next.9 → 1.24.0
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 +10 -11
- package/dist/index.mjs +10 -11
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
var AST2 = require('@eslint-react/ast');
|
|
4
4
|
var core = require('@eslint-react/core');
|
|
5
5
|
var eff = require('@eslint-react/eff');
|
|
6
|
-
require('@eslint-react/jsx');
|
|
7
6
|
var VAR2 = require('@eslint-react/var');
|
|
8
7
|
var utils = require('@typescript-eslint/utils');
|
|
9
8
|
var tsPattern = require('ts-pattern');
|
|
@@ -33,7 +32,7 @@ var VAR2__namespace = /*#__PURE__*/_interopNamespace(VAR2);
|
|
|
33
32
|
|
|
34
33
|
// package.json
|
|
35
34
|
var name = "eslint-plugin-react-web-api";
|
|
36
|
-
var version = "1.24.0
|
|
35
|
+
var version = "1.24.0";
|
|
37
36
|
var createRule = shared.createRuleForPlugin("web-api");
|
|
38
37
|
function getInstanceID(node, prev) {
|
|
39
38
|
switch (true) {
|
|
@@ -71,9 +70,9 @@ var defaultOptions = {
|
|
|
71
70
|
};
|
|
72
71
|
function getCallKind(node) {
|
|
73
72
|
switch (true) {
|
|
74
|
-
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("addEventListener", "removeEventListener", "abort")
|
|
73
|
+
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("addEventListener", "removeEventListener", "abort"))(node.callee.name)):
|
|
75
74
|
return node.callee.name;
|
|
76
|
-
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("addEventListener", "removeEventListener", "abort")
|
|
75
|
+
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("addEventListener", "removeEventListener", "abort"))(node.callee.property.name)):
|
|
77
76
|
return node.callee.property.name;
|
|
78
77
|
default:
|
|
79
78
|
return "other";
|
|
@@ -108,7 +107,7 @@ function getOptions(node, initialScope) {
|
|
|
108
107
|
break;
|
|
109
108
|
}
|
|
110
109
|
default: {
|
|
111
|
-
v = VAR2__namespace.
|
|
110
|
+
v = VAR2__namespace.toStaticValue({ kind: "lazy", node: value, initialScope }).value;
|
|
112
111
|
break;
|
|
113
112
|
}
|
|
114
113
|
}
|
|
@@ -295,9 +294,9 @@ var RULE_FEATURES2 = [
|
|
|
295
294
|
];
|
|
296
295
|
function getCallKind2(node) {
|
|
297
296
|
switch (true) {
|
|
298
|
-
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setInterval", "clearInterval")
|
|
297
|
+
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setInterval", "clearInterval"))(node.callee.name)):
|
|
299
298
|
return node.callee.name;
|
|
300
|
-
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setInterval", "clearInterval")
|
|
299
|
+
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setInterval", "clearInterval"))(node.callee.property.name)):
|
|
301
300
|
return node.callee.property.name;
|
|
302
301
|
default:
|
|
303
302
|
return "other";
|
|
@@ -441,9 +440,9 @@ function isFromObserver(node, context) {
|
|
|
441
440
|
}
|
|
442
441
|
function getCallKind3(node, context) {
|
|
443
442
|
switch (true) {
|
|
444
|
-
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("observe", "unobserve", "disconnect")
|
|
443
|
+
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("observe", "unobserve", "disconnect"))(node.callee.name) && isFromObserver(node.callee, context)):
|
|
445
444
|
return node.callee.name;
|
|
446
|
-
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("observe", "unobserve", "disconnect")
|
|
445
|
+
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("observe", "unobserve", "disconnect"))(node.callee.property.name) && isFromObserver(node.callee, context)):
|
|
447
446
|
return node.callee.property.name;
|
|
448
447
|
default:
|
|
449
448
|
return "other";
|
|
@@ -588,9 +587,9 @@ var RULE_FEATURES4 = [
|
|
|
588
587
|
];
|
|
589
588
|
function getCallKind4(node) {
|
|
590
589
|
switch (true) {
|
|
591
|
-
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setTimeout", "clearTimeout")
|
|
590
|
+
case (node.callee.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setTimeout", "clearTimeout"))(node.callee.name)):
|
|
592
591
|
return node.callee.name;
|
|
593
|
-
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setTimeout", "clearTimeout")
|
|
592
|
+
case (node.callee.type === utils.AST_NODE_TYPES.MemberExpression && node.callee.property.type === utils.AST_NODE_TYPES.Identifier && tsPattern.isMatching(tsPattern.P.union("setTimeout", "clearTimeout"))(node.callee.property.name)):
|
|
594
593
|
return node.callee.property.name;
|
|
595
594
|
default:
|
|
596
595
|
return "other";
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as AST2 from '@eslint-react/ast';
|
|
2
2
|
import { ERPhaseRelevance, isFunctionOfUseEffectSetup, isFunctionOfUseEffectCleanup, isFunctionOfComponentDidMount, isFunctionOfComponentWillUnmount, isInversePhase } from '@eslint-react/core';
|
|
3
3
|
import { _, or } from '@eslint-react/eff';
|
|
4
|
-
import '@eslint-react/jsx';
|
|
5
4
|
import * as VAR2 from '@eslint-react/var';
|
|
6
5
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
7
6
|
import { match, isMatching, P } from 'ts-pattern';
|
|
@@ -10,7 +9,7 @@ import { AST_NODE_TYPES as AST_NODE_TYPES$1 } from '@typescript-eslint/types';
|
|
|
10
9
|
|
|
11
10
|
// package.json
|
|
12
11
|
var name = "eslint-plugin-react-web-api";
|
|
13
|
-
var version = "1.24.0
|
|
12
|
+
var version = "1.24.0";
|
|
14
13
|
var createRule = createRuleForPlugin("web-api");
|
|
15
14
|
function getInstanceID(node, prev) {
|
|
16
15
|
switch (true) {
|
|
@@ -48,9 +47,9 @@ var defaultOptions = {
|
|
|
48
47
|
};
|
|
49
48
|
function getCallKind(node) {
|
|
50
49
|
switch (true) {
|
|
51
|
-
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("addEventListener", "removeEventListener", "abort")
|
|
50
|
+
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("addEventListener", "removeEventListener", "abort"))(node.callee.name)):
|
|
52
51
|
return node.callee.name;
|
|
53
|
-
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("addEventListener", "removeEventListener", "abort")
|
|
52
|
+
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("addEventListener", "removeEventListener", "abort"))(node.callee.property.name)):
|
|
54
53
|
return node.callee.property.name;
|
|
55
54
|
default:
|
|
56
55
|
return "other";
|
|
@@ -85,7 +84,7 @@ function getOptions(node, initialScope) {
|
|
|
85
84
|
break;
|
|
86
85
|
}
|
|
87
86
|
default: {
|
|
88
|
-
v = VAR2.
|
|
87
|
+
v = VAR2.toStaticValue({ kind: "lazy", node: value, initialScope }).value;
|
|
89
88
|
break;
|
|
90
89
|
}
|
|
91
90
|
}
|
|
@@ -272,9 +271,9 @@ var RULE_FEATURES2 = [
|
|
|
272
271
|
];
|
|
273
272
|
function getCallKind2(node) {
|
|
274
273
|
switch (true) {
|
|
275
|
-
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setInterval", "clearInterval")
|
|
274
|
+
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setInterval", "clearInterval"))(node.callee.name)):
|
|
276
275
|
return node.callee.name;
|
|
277
|
-
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setInterval", "clearInterval")
|
|
276
|
+
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setInterval", "clearInterval"))(node.callee.property.name)):
|
|
278
277
|
return node.callee.property.name;
|
|
279
278
|
default:
|
|
280
279
|
return "other";
|
|
@@ -418,9 +417,9 @@ function isFromObserver(node, context) {
|
|
|
418
417
|
}
|
|
419
418
|
function getCallKind3(node, context) {
|
|
420
419
|
switch (true) {
|
|
421
|
-
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("observe", "unobserve", "disconnect")
|
|
420
|
+
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("observe", "unobserve", "disconnect"))(node.callee.name) && isFromObserver(node.callee, context)):
|
|
422
421
|
return node.callee.name;
|
|
423
|
-
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("observe", "unobserve", "disconnect")
|
|
422
|
+
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("observe", "unobserve", "disconnect"))(node.callee.property.name) && isFromObserver(node.callee, context)):
|
|
424
423
|
return node.callee.property.name;
|
|
425
424
|
default:
|
|
426
425
|
return "other";
|
|
@@ -565,9 +564,9 @@ var RULE_FEATURES4 = [
|
|
|
565
564
|
];
|
|
566
565
|
function getCallKind4(node) {
|
|
567
566
|
switch (true) {
|
|
568
|
-
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setTimeout", "clearTimeout")
|
|
567
|
+
case (node.callee.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setTimeout", "clearTimeout"))(node.callee.name)):
|
|
569
568
|
return node.callee.name;
|
|
570
|
-
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setTimeout", "clearTimeout")
|
|
569
|
+
case (node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.property.type === AST_NODE_TYPES.Identifier && isMatching(P.union("setTimeout", "clearTimeout"))(node.callee.property.name)):
|
|
571
570
|
return node.callee.property.name;
|
|
572
571
|
default:
|
|
573
572
|
return "other";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "1.24.0
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"@typescript-eslint/types": "^8.20.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.20.0",
|
|
47
47
|
"string-ts": "^2.2.0",
|
|
48
|
-
"ts-pattern": "^5.6.
|
|
49
|
-
"@eslint-react/ast": "1.24.0
|
|
50
|
-
"@eslint-react/eff": "1.24.0
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
48
|
+
"ts-pattern": "^5.6.1",
|
|
49
|
+
"@eslint-react/ast": "1.24.0",
|
|
50
|
+
"@eslint-react/eff": "1.24.0",
|
|
51
|
+
"@eslint-react/core": "1.24.0",
|
|
52
|
+
"@eslint-react/jsx": "1.24.0",
|
|
53
|
+
"@eslint-react/var": "1.24.0",
|
|
54
|
+
"@eslint-react/shared": "1.24.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/react": "^19.0.7",
|