eslint-plugin-react-web-api 3.0.0-next.2 → 3.0.0-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 +8 -16
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ const settings = { "react-x": DEFAULT_ESLINT_REACT_SETTINGS };
|
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region package.json
|
|
45
45
|
var name = "eslint-plugin-react-web-api";
|
|
46
|
-
var version = "3.0.0-next.
|
|
46
|
+
var version = "3.0.0-next.6";
|
|
47
47
|
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/types/component-phase.ts
|
|
@@ -92,20 +92,6 @@ function getOptions(node, initialScope) {
|
|
|
92
92
|
function findProp(properties, propName) {
|
|
93
93
|
return findProperty(propName, properties, initialScope);
|
|
94
94
|
}
|
|
95
|
-
function getPropValue(prop, filter = (a) => true) {
|
|
96
|
-
if (prop?.type !== AST_NODE_TYPES.Property) return unit;
|
|
97
|
-
const { value } = prop;
|
|
98
|
-
let v = value;
|
|
99
|
-
switch (value.type) {
|
|
100
|
-
case AST_NODE_TYPES.Literal:
|
|
101
|
-
v = value.value;
|
|
102
|
-
break;
|
|
103
|
-
default:
|
|
104
|
-
v = getStaticValue(value, initialScope)?.value;
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
return filter(v) ? v : unit;
|
|
108
|
-
}
|
|
109
95
|
function getOpts(node) {
|
|
110
96
|
switch (node.type) {
|
|
111
97
|
case AST_NODE_TYPES.Identifier: {
|
|
@@ -118,7 +104,13 @@ function getOptions(node, initialScope) {
|
|
|
118
104
|
capture: Boolean(node.value)
|
|
119
105
|
};
|
|
120
106
|
case AST_NODE_TYPES.ObjectExpression: {
|
|
121
|
-
const vCapture =
|
|
107
|
+
const vCapture = match(findProp(node.properties, "capture")).with(P.nullish, () => false).with({ type: AST_NODE_TYPES.Property }, (prop) => {
|
|
108
|
+
const value = prop.value;
|
|
109
|
+
switch (value.type) {
|
|
110
|
+
case AST_NODE_TYPES.Literal: return Boolean(value.value);
|
|
111
|
+
default: return Boolean(getStaticValue(value, initialScope)?.value);
|
|
112
|
+
}
|
|
113
|
+
}).otherwise(() => false);
|
|
122
114
|
const pSignal = findProp(node.properties, "signal");
|
|
123
115
|
return {
|
|
124
116
|
capture: vCapture,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-web-api",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.6",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for interacting with Web APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
"./package.json"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@typescript-eslint/scope-manager": "
|
|
42
|
-
"@typescript-eslint/types": "
|
|
43
|
-
"@typescript-eslint/utils": "
|
|
41
|
+
"@typescript-eslint/scope-manager": "canary",
|
|
42
|
+
"@typescript-eslint/types": "canary",
|
|
43
|
+
"@typescript-eslint/utils": "canary",
|
|
44
44
|
"birecord": "^0.1.1",
|
|
45
45
|
"ts-pattern": "^5.9.0",
|
|
46
|
-
"@eslint-react/
|
|
47
|
-
"@eslint-react/
|
|
48
|
-
"@eslint-react/
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
46
|
+
"@eslint-react/eff": "3.0.0-next.6",
|
|
47
|
+
"@eslint-react/ast": "3.0.0-next.6",
|
|
48
|
+
"@eslint-react/shared": "3.0.0-next.6",
|
|
49
|
+
"@eslint-react/core": "3.0.0-next.6",
|
|
50
|
+
"@eslint-react/var": "3.0.0-next.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/react": "^19.2.14",
|