eslint-plugin-react-web-api 5.24.10 → 5.26.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 +8 -8
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region package.json
|
|
23
23
|
var name$1 = "eslint-plugin-react-web-api";
|
|
24
|
-
var version = "5.
|
|
24
|
+
var version = "5.26.0";
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/utils/create-rule.ts
|
|
27
27
|
function getDocsUrl(ruleName) {
|
|
@@ -231,7 +231,7 @@ function resolveCleanupCallee(context, node) {
|
|
|
231
231
|
for (const prop of init.properties) {
|
|
232
232
|
if (prop.type !== AST_NODE_TYPES.Property || prop.computed) continue;
|
|
233
233
|
const key = Extract.unwrap(prop.key);
|
|
234
|
-
if ((key.type === AST_NODE_TYPES.Identifier ? key.name :
|
|
234
|
+
if ((key.type === AST_NODE_TYPES.Identifier ? key.name : isString(key.value) ? key.value : null) !== property.name) continue;
|
|
235
235
|
const value = Extract.unwrap(prop.value);
|
|
236
236
|
if (Check.isFunction(value)) return {
|
|
237
237
|
kind: "function",
|
|
@@ -584,8 +584,8 @@ function create$3(context) {
|
|
|
584
584
|
const returnedCleanups = /* @__PURE__ */ new Set();
|
|
585
585
|
const cleanupCallees = /* @__PURE__ */ new Set();
|
|
586
586
|
function isInCleanupPhase(node) {
|
|
587
|
-
if (Traverse.
|
|
588
|
-
for (const fn of [...returnedCleanups, ...cleanupCallees]) if (Traverse.
|
|
587
|
+
if (Traverse.hasParent(node, isUseEffectCleanupCallback)) return true;
|
|
588
|
+
for (const fn of [...returnedCleanups, ...cleanupCallees]) if (Traverse.hasParent(node, (n) => n === fn)) return true;
|
|
589
589
|
return false;
|
|
590
590
|
}
|
|
591
591
|
return {
|
|
@@ -657,7 +657,7 @@ function create$3(context) {
|
|
|
657
657
|
["Program:exit"]() {
|
|
658
658
|
for (const { id, node, phaseNode } of observers) {
|
|
659
659
|
const isSameObserver = phaseNode == null ? (observer) => isFromRefCurrent$1(context, observer, id) : (observer) => isAssignmentTargetEqual(context, observer, id);
|
|
660
|
-
const isInsideObserverCallback = (entryNode) => Traverse.
|
|
660
|
+
const isInsideObserverCallback = (entryNode) => Traverse.hasParent(entryNode, (n) => n === node);
|
|
661
661
|
if (dEntries.some((e) => !isInsideObserverCallback(e.node) && isInCleanupPhase(e.node) && isSameObserver(e.observer))) continue;
|
|
662
662
|
const matchedOEntries = oEntries.filter((e) => isSameObserver(e.observer));
|
|
663
663
|
const matchedUEntries = uEntries.filter((e) => isSameObserver(e.observer));
|
|
@@ -831,8 +831,8 @@ function create$1(context) {
|
|
|
831
831
|
const returnedCleanups = /* @__PURE__ */ new Set();
|
|
832
832
|
const cleanupCallees = /* @__PURE__ */ new Set();
|
|
833
833
|
function isInCleanupPhase(node) {
|
|
834
|
-
if (Traverse.
|
|
835
|
-
for (const fn of [...returnedCleanups, ...cleanupCallees]) if (Traverse.
|
|
834
|
+
if (Traverse.hasParent(node, isUseEffectCleanupCallback)) return true;
|
|
835
|
+
for (const fn of [...returnedCleanups, ...cleanupCallees]) if (Traverse.hasParent(node, (n) => n === fn)) return true;
|
|
836
836
|
return false;
|
|
837
837
|
}
|
|
838
838
|
return {
|
|
@@ -904,7 +904,7 @@ function create$1(context) {
|
|
|
904
904
|
["Program:exit"]() {
|
|
905
905
|
for (const { id, node, phaseNode } of observers) {
|
|
906
906
|
const isSameObserver = phaseNode == null ? (observer) => isFromRefCurrent(context, observer, id) : (observer) => isAssignmentTargetEqual(context, observer, id);
|
|
907
|
-
const isInsideObserverCallback = (entryNode) => Traverse.
|
|
907
|
+
const isInsideObserverCallback = (entryNode) => Traverse.hasParent(entryNode, (n) => n === node);
|
|
908
908
|
if (dEntries.some((e) => !isInsideObserverCallback(e.node) && isInCleanupPhase(e.node) && isSameObserver(e.observer))) continue;
|
|
909
909
|
const matchedOEntries = oEntries.filter((e) => isSameObserver(e.observer));
|
|
910
910
|
const matchedUEntries = uEntries.filter((e) => isSameObserver(e.observer));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.26.0",
|
|
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.
|
|
41
|
-
"@eslint-react/core": "5.
|
|
42
|
-
"@eslint-react/eslint": "5.
|
|
43
|
-
"@eslint-react/shared": "5.
|
|
44
|
-
"@eslint-react/var": "5.
|
|
40
|
+
"@eslint-react/ast": "5.26.0",
|
|
41
|
+
"@eslint-react/core": "5.26.0",
|
|
42
|
+
"@eslint-react/eslint": "5.26.0",
|
|
43
|
+
"@eslint-react/shared": "5.26.0",
|
|
44
|
+
"@eslint-react/var": "5.26.0",
|
|
45
45
|
"@typescript-eslint/types": "^8.71.1",
|
|
46
46
|
"@typescript-eslint/utils": "^8.71.1",
|
|
47
47
|
"ts-pattern": "^5.9.0"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@types/react-dom": "^19.3.0",
|
|
55
55
|
"dedent": "^1.7.2",
|
|
56
56
|
"eslint": "^10.12.0",
|
|
57
|
-
"tsdown": "^0.23.
|
|
57
|
+
"tsdown": "^0.23.1",
|
|
58
58
|
"typescript": "6.0.3"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
|
-
"node": ">=
|
|
70
|
+
"node": ">=20.19.0"
|
|
71
71
|
},
|
|
72
72
|
"inlinedDependencies": {
|
|
73
73
|
"@local/eff": "workspace:*"
|