eslint-plugin-react-web-api 2.0.0-beta.52 → 2.0.0-beta.54
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.d.ts +7 -36
- package/dist/index.js +11 -11
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,39 +1,15 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _eslint_react_shared0 from "@eslint-react/shared";
|
|
2
2
|
import { RulePreset } from "@eslint-react/kit";
|
|
3
3
|
|
|
4
|
-
//#region src/rules/no-leaked-event-listener.d.ts
|
|
5
|
-
|
|
6
|
-
type MessageID$3 = "expectedRemoveEventListenerInCleanup" | "expectedRemoveEventListenerInUnmount" | "unexpectedInlineFunction";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/rules/no-leaked-interval.d.ts
|
|
9
|
-
type MessageID$2 = "expectedClearIntervalInCleanup" | "expectedClearIntervalInUnmount" | "expectedIntervalId";
|
|
10
|
-
//#endregion
|
|
11
|
-
//#region src/rules/no-leaked-resize-observer.d.ts
|
|
12
|
-
type MessageID$1 = "expectedDisconnectInControlFlow" | "expectedDisconnectOrUnobserveInCleanup" | "unexpectedFloatingInstance";
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/rules/no-leaked-timeout.d.ts
|
|
15
|
-
type MessageID = "expectedClearTimeoutInCleanup" | "expectedClearTimeoutInUnmount" | "expectedTimeoutId";
|
|
16
|
-
//#endregion
|
|
17
4
|
//#region src/index.d.ts
|
|
18
5
|
declare const _default: {
|
|
19
6
|
configs: {
|
|
20
7
|
recommended: {
|
|
21
8
|
plugins: {
|
|
22
|
-
"react-web-api":
|
|
23
|
-
readonly meta: {
|
|
24
|
-
readonly name: string;
|
|
25
|
-
readonly version: string;
|
|
26
|
-
};
|
|
27
|
-
readonly rules: {
|
|
28
|
-
readonly "no-leaked-event-listener": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID$3, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
29
|
-
readonly "no-leaked-interval": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID$2, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
30
|
-
readonly "no-leaked-resize-observer": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID$1, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
31
|
-
readonly "no-leaked-timeout": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
9
|
+
"react-web-api": _eslint_react_shared0.CompatiblePlugin;
|
|
34
10
|
};
|
|
35
|
-
name
|
|
36
|
-
rules
|
|
11
|
+
name?: string;
|
|
12
|
+
rules?: Record<string, any>;
|
|
37
13
|
};
|
|
38
14
|
"recommended-legacy": {
|
|
39
15
|
plugins: string[];
|
|
@@ -41,15 +17,10 @@ declare const _default: {
|
|
|
41
17
|
};
|
|
42
18
|
};
|
|
43
19
|
meta: {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
rules: {
|
|
48
|
-
readonly "no-leaked-event-listener": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID$3, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
49
|
-
readonly "no-leaked-interval": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID$2, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
50
|
-
readonly "no-leaked-resize-observer": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID$1, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
51
|
-
readonly "no-leaked-timeout": _typescript_eslint_utils_ts_eslint0.RuleModule<MessageID, [], unknown, _typescript_eslint_utils_ts_eslint0.RuleListener>;
|
|
20
|
+
name: string;
|
|
21
|
+
version: string;
|
|
52
22
|
};
|
|
23
|
+
rules: Record<string, any>;
|
|
53
24
|
};
|
|
54
25
|
//#endregion
|
|
55
26
|
export { _default as default };
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region package.json
|
|
38
38
|
var name = "eslint-plugin-react-web-api";
|
|
39
|
-
var version = "2.0.0-beta.
|
|
39
|
+
var version = "2.0.0-beta.54";
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/utils/create-rule.ts
|
|
@@ -92,14 +92,14 @@ function getFunctionKind$1(node) {
|
|
|
92
92
|
function getSignalValueExpression(node, initialScope) {
|
|
93
93
|
if (node == null) return unit;
|
|
94
94
|
switch (node.type) {
|
|
95
|
-
case AST_NODE_TYPES.Identifier: return getSignalValueExpression(VAR.
|
|
95
|
+
case AST_NODE_TYPES.Identifier: return getSignalValueExpression(VAR.getVariableDefinitionNode(VAR.findVariable(node, initialScope), 0), initialScope);
|
|
96
96
|
case AST_NODE_TYPES.MemberExpression: return node;
|
|
97
97
|
default: return unit;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
function getOptions(node, initialScope) {
|
|
101
101
|
function findProp(properties, propName) {
|
|
102
|
-
return VAR.
|
|
102
|
+
return VAR.findProperty(propName, properties, initialScope);
|
|
103
103
|
}
|
|
104
104
|
function getPropValue(prop, filter = (a) => true) {
|
|
105
105
|
if (prop?.type !== AST_NODE_TYPES.Property) return unit;
|
|
@@ -123,7 +123,7 @@ function getOptions(node, initialScope) {
|
|
|
123
123
|
switch (node$1.type) {
|
|
124
124
|
case AST_NODE_TYPES.Identifier: {
|
|
125
125
|
const variable = VAR.findVariable(node$1, initialScope);
|
|
126
|
-
const variableNode = VAR.
|
|
126
|
+
const variableNode = VAR.getVariableDefinitionNode(variable, 0);
|
|
127
127
|
if (variableNode?.type === AST_NODE_TYPES.ObjectExpression) return getOpts(variableNode);
|
|
128
128
|
return defaultOptions;
|
|
129
129
|
}
|
|
@@ -323,7 +323,7 @@ function create$2(context) {
|
|
|
323
323
|
const fEntry = fEntries.findLast((x) => x.kind !== "other");
|
|
324
324
|
if (fEntry == null) break;
|
|
325
325
|
if (!ER.ComponentPhaseRelevance.has(fEntry.kind)) break;
|
|
326
|
-
const intervalIdNode = VAR.
|
|
326
|
+
const intervalIdNode = VAR.findAssignmentTarget(node);
|
|
327
327
|
if (intervalIdNode == null) {
|
|
328
328
|
context.report({
|
|
329
329
|
messageId: "expectedIntervalId",
|
|
@@ -394,7 +394,7 @@ function isFromObserver(context, node) {
|
|
|
394
394
|
switch (true) {
|
|
395
395
|
case node.type === AST_NODE_TYPES.Identifier: {
|
|
396
396
|
const initialScope = context.sourceCode.getScope(node);
|
|
397
|
-
const object = VAR.
|
|
397
|
+
const object = VAR.getVariableDefinitionNode(VAR.findVariable(node, initialScope), 0);
|
|
398
398
|
return isNewResizeObserver(object);
|
|
399
399
|
}
|
|
400
400
|
case node.type === AST_NODE_TYPES.MemberExpression: return isFromObserver(context, node.object);
|
|
@@ -587,7 +587,7 @@ function create(context) {
|
|
|
587
587
|
if (!ER.ComponentPhaseRelevance.has(fEntry?.kind)) return;
|
|
588
588
|
switch (getCallKind(node)) {
|
|
589
589
|
case "setTimeout": {
|
|
590
|
-
const timeoutIdNode = VAR.
|
|
590
|
+
const timeoutIdNode = VAR.findAssignmentTarget(node);
|
|
591
591
|
if (timeoutIdNode == null) {
|
|
592
592
|
context.report({
|
|
593
593
|
messageId: "expectedTimeoutId",
|
|
@@ -661,13 +661,13 @@ const plugin = {
|
|
|
661
661
|
|
|
662
662
|
//#endregion
|
|
663
663
|
//#region src/index.ts
|
|
664
|
-
function
|
|
664
|
+
function toFlatConfig(config) {
|
|
665
665
|
return {
|
|
666
666
|
...config,
|
|
667
667
|
plugins: { "react-web-api": plugin }
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function toLegacyConfig({ rules: rules$1 }) {
|
|
671
671
|
return {
|
|
672
672
|
plugins: ["react-web-api"],
|
|
673
673
|
rules: rules$1
|
|
@@ -676,8 +676,8 @@ function makeLegacyConfig({ rules: rules$1 }) {
|
|
|
676
676
|
var src_default = {
|
|
677
677
|
...plugin,
|
|
678
678
|
configs: {
|
|
679
|
-
["recommended"]:
|
|
680
|
-
["recommended-legacy"]:
|
|
679
|
+
["recommended"]: toFlatConfig(recommended_exports),
|
|
680
|
+
["recommended-legacy"]: toLegacyConfig(recommended_exports)
|
|
681
681
|
}
|
|
682
682
|
};
|
|
683
683
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.54",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@typescript-eslint/utils": "^8.41.0",
|
|
41
41
|
"string-ts": "^2.2.1",
|
|
42
42
|
"ts-pattern": "^5.8.0",
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint-react/
|
|
45
|
-
"@eslint-react/
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
43
|
+
"@eslint-react/ast": "2.0.0-beta.54",
|
|
44
|
+
"@eslint-react/eff": "2.0.0-beta.54",
|
|
45
|
+
"@eslint-react/core": "2.0.0-beta.54",
|
|
46
|
+
"@eslint-react/shared": "2.0.0-beta.54",
|
|
47
|
+
"@eslint-react/kit": "2.0.0-beta.54",
|
|
48
|
+
"@eslint-react/var": "2.0.0-beta.54"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@types/react": "^19.1.
|
|
52
|
-
"@types/react-dom": "^19.1.
|
|
51
|
+
"@types/react": "^19.1.12",
|
|
52
|
+
"@types/react-dom": "^19.1.9",
|
|
53
53
|
"tsdown": "^0.14.2",
|
|
54
54
|
"@local/configs": "0.0.0"
|
|
55
55
|
},
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
|
-
"build": "tsdown
|
|
75
|
+
"build": "tsdown",
|
|
76
76
|
"lint:publish": "publint",
|
|
77
77
|
"lint:ts": "tsc --noEmit"
|
|
78
78
|
}
|