eslint-plugin-react-web-api 5.24.0-beta.0 → 5.24.0-beta.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 +12 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region package.json
|
|
29
29
|
var name$1 = "eslint-plugin-react-web-api";
|
|
30
|
-
var version = "5.24.0-beta.
|
|
30
|
+
var version = "5.24.0-beta.2";
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/create-rule.ts
|
|
@@ -42,6 +42,16 @@ function or(a, b) {
|
|
|
42
42
|
return (data) => a(data) || b(data);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
+
* A function that checks if the passed parameter is a string and narrows its type accordingly.
|
|
46
|
+
*
|
|
47
|
+
* @param data - The variable to check.
|
|
48
|
+
* @returns True if the passed input is a string, false otherwise.
|
|
49
|
+
* @category guards
|
|
50
|
+
*/
|
|
51
|
+
function isString(data) {
|
|
52
|
+
return typeof data === "string";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
45
55
|
* Applies a `pipe` method's variadic arguments to an initial value from left
|
|
46
56
|
* to right.
|
|
47
57
|
*
|
|
@@ -616,7 +626,7 @@ function resolveCleanupCallee(context, node) {
|
|
|
616
626
|
for (const prop of init.properties) {
|
|
617
627
|
if (prop.type !== AST_NODE_TYPES.Property || prop.computed) continue;
|
|
618
628
|
const key = Extract.unwrap(prop.key);
|
|
619
|
-
if ((key.type === AST_NODE_TYPES.Identifier ? key.name : key.type === AST_NODE_TYPES.Literal &&
|
|
629
|
+
if ((key.type === AST_NODE_TYPES.Identifier ? key.name : key.type === AST_NODE_TYPES.Literal && isString(key.value) ? key.value : null) !== property.name) continue;
|
|
620
630
|
const value = Extract.unwrap(prop.value);
|
|
621
631
|
if (Check.isFunction(value)) return {
|
|
622
632
|
kind: "function",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "5.24.0-beta.
|
|
3
|
+
"version": "5.24.0-beta.2",
|
|
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.24.0-beta.
|
|
41
|
-
"@eslint-react/core": "5.24.0-beta.
|
|
42
|
-
"@eslint-react/eslint": "5.24.0-beta.
|
|
43
|
-
"@eslint-react/shared": "5.24.0-beta.
|
|
44
|
-
"@eslint-react/var": "5.24.0-beta.
|
|
40
|
+
"@eslint-react/ast": "5.24.0-beta.2",
|
|
41
|
+
"@eslint-react/core": "5.24.0-beta.2",
|
|
42
|
+
"@eslint-react/eslint": "5.24.0-beta.2",
|
|
43
|
+
"@eslint-react/shared": "5.24.0-beta.2",
|
|
44
|
+
"@eslint-react/var": "5.24.0-beta.2",
|
|
45
45
|
"@typescript-eslint/types": "^8.71.0",
|
|
46
46
|
"@typescript-eslint/utils": "^8.71.0",
|
|
47
47
|
"ts-pattern": "^5.9.0"
|