@eslint-react/jsx 5.24.3 → 5.24.5
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 +13 -28
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import { resolve } from "@eslint-react/var";
|
|
|
3
3
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
4
4
|
import { getStaticValue } from "@typescript-eslint/utils/ast-utils";
|
|
5
5
|
import { P, match } from "ts-pattern";
|
|
6
|
-
|
|
7
6
|
//#region ../../.pkgs/eff/dist/index.js
|
|
8
7
|
const pipeArguments = (self, args) => {
|
|
9
8
|
switch (args.length) {
|
|
@@ -27,7 +26,7 @@ const pipeArguments = (self, args) => {
|
|
|
27
26
|
const Prototype = { pipe() {
|
|
28
27
|
return pipeArguments(this, arguments);
|
|
29
28
|
} };
|
|
30
|
-
|
|
29
|
+
(function() {
|
|
31
30
|
function PipeableBase() {}
|
|
32
31
|
PipeableBase.prototype = Prototype;
|
|
33
32
|
return PipeableBase;
|
|
@@ -62,45 +61,39 @@ const dual = function(arity, body) {
|
|
|
62
61
|
};
|
|
63
62
|
const identity = (a) => a;
|
|
64
63
|
const cast = identity;
|
|
65
|
-
|
|
66
|
-
const constTrue = constant(true);
|
|
67
|
-
const constFalse = constant(false);
|
|
68
|
-
const constNull = constant(null);
|
|
69
|
-
const constUndefined = constant(void 0);
|
|
70
|
-
const compose = dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
64
|
+
dual(2, (ab, bc) => (a) => bc(ab(a)));
|
|
71
65
|
const absurd = (_) => {
|
|
72
66
|
throw new Error("Called `absurd` function which should be uncallable");
|
|
73
67
|
};
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
cast(absurd);
|
|
69
|
+
dual(2, (a, b) => (data) => a(data) && b(data));
|
|
76
70
|
const or = dual(2, (a, b) => (data) => a(data) || b(data));
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
dual(2, (a, b) => (data) => a(data) !== b(data));
|
|
72
|
+
dual(2, (a, b) => (data) => a(data) === b(data));
|
|
73
|
+
dual(2, (antecedent, consequent) => (data) => !antecedent(data) || consequent(data));
|
|
74
|
+
dual(2, (a, b) => (data) => !a(data) && !b(data));
|
|
75
|
+
dual(2, (a, b) => (data) => !a(data) || !b(data));
|
|
82
76
|
function isFunction(input) {
|
|
83
77
|
return typeof input === "function";
|
|
84
78
|
}
|
|
85
79
|
function isObjectKeyword(input) {
|
|
86
80
|
return typeof input === "object" && input !== null || isFunction(input);
|
|
87
81
|
}
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
dual(2, (data, property) => isObjectKeyword(data) && property in data);
|
|
83
|
+
dual(2, (self, predicate) => {
|
|
90
84
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
91
85
|
const len = input.length;
|
|
92
86
|
let idx = 0;
|
|
93
87
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
94
88
|
return input.slice(idx);
|
|
95
89
|
});
|
|
96
|
-
|
|
90
|
+
dual(2, (self, predicate) => {
|
|
97
91
|
const input = Array.isArray(self) ? self : Array.from(self);
|
|
98
92
|
const len = input.length;
|
|
99
93
|
let idx = 0;
|
|
100
94
|
while (idx < len && predicate(input[idx], idx)) idx++;
|
|
101
95
|
return input.slice(0, idx);
|
|
102
96
|
});
|
|
103
|
-
|
|
104
97
|
//#endregion
|
|
105
98
|
//#region src/attribute-name.ts
|
|
106
99
|
function getAttributeName(node) {
|
|
@@ -110,7 +103,6 @@ function getAttributeName(node) {
|
|
|
110
103
|
const isAttribute = dual(2, (node, name) => {
|
|
111
104
|
return node.type === AST_NODE_TYPES.JSXAttribute && node.name.type === AST_NODE_TYPES.JSXIdentifier && node.name.name === name;
|
|
112
105
|
});
|
|
113
|
-
|
|
114
106
|
//#endregion
|
|
115
107
|
//#region src/attribute-find.ts
|
|
116
108
|
function findAttribute(context, element, name) {
|
|
@@ -156,7 +148,6 @@ function findSpreadProperty(context, argument, name, seen = /* @__PURE__ */ new
|
|
|
156
148
|
if (found != null) return found;
|
|
157
149
|
}
|
|
158
150
|
}
|
|
159
|
-
|
|
160
151
|
//#endregion
|
|
161
152
|
//#region src/attribute-has.ts
|
|
162
153
|
function hasAttribute(context, element, name) {
|
|
@@ -168,7 +159,6 @@ function hasAnyAttribute(context, element, names) {
|
|
|
168
159
|
function hasEveryAttribute(context, element, names) {
|
|
169
160
|
return names.every((name) => findAttribute(context, element, name) != null);
|
|
170
161
|
}
|
|
171
|
-
|
|
172
162
|
//#endregion
|
|
173
163
|
//#region src/attribute-value.ts
|
|
174
164
|
function resolveAttributeValue(context, attribute, name) {
|
|
@@ -246,7 +236,6 @@ function resolveJsxSpreadAttribute(context, node, name) {
|
|
|
246
236
|
}
|
|
247
237
|
};
|
|
248
238
|
}
|
|
249
|
-
|
|
250
239
|
//#endregion
|
|
251
240
|
//#region src/text.ts
|
|
252
241
|
function collapseMultilineText(text) {
|
|
@@ -283,7 +272,6 @@ function isEmptyStringExpression(node) {
|
|
|
283
272
|
if (expr.type !== AST_NODE_TYPES.Literal) return false;
|
|
284
273
|
return expr.value === "";
|
|
285
274
|
}
|
|
286
|
-
|
|
287
275
|
//#endregion
|
|
288
276
|
//#region src/children.ts
|
|
289
277
|
function getChildren(element) {
|
|
@@ -302,7 +290,6 @@ function hasChildren(element) {
|
|
|
302
290
|
if (element.children.length === 0) return false;
|
|
303
291
|
return !element.children.every(or(isWhitespaceText, isEmptyStringExpression));
|
|
304
292
|
}
|
|
305
|
-
|
|
306
293
|
//#endregion
|
|
307
294
|
//#region src/element-type.ts
|
|
308
295
|
function getElementFullType(node) {
|
|
@@ -319,7 +306,6 @@ function getElementFullType(node) {
|
|
|
319
306
|
function getElementSelfType(node) {
|
|
320
307
|
return getElementFullType(node).split(".").at(-1) ?? "";
|
|
321
308
|
}
|
|
322
|
-
|
|
323
309
|
//#endregion
|
|
324
310
|
//#region src/element-is.ts
|
|
325
311
|
function isElement(node, test) {
|
|
@@ -342,6 +328,5 @@ function isHostElement(node) {
|
|
|
342
328
|
if (name.type === AST_NODE_TYPES.JSXNamespacedName) return /^[a-z]/u.test(name.name.name);
|
|
343
329
|
return false;
|
|
344
330
|
}
|
|
345
|
-
|
|
346
331
|
//#endregion
|
|
347
|
-
export { collapseMultilineText, findAttribute, findParentAttribute, findSpreadProperty, getAttributeName, getAttributeStaticValue, getAttributeValue, getChildren, getElementFullType, getElementSelfType, hasAnyAttribute, hasAttribute, hasChildren, hasEveryAttribute, isAttribute, isElement, isEmptyStringExpression, isFragmentElement, isHostElement, isPaddingWhitespace, isWhitespaceText, resolveAttributeValue };
|
|
332
|
+
export { collapseMultilineText, findAttribute, findParentAttribute, findSpreadProperty, getAttributeName, getAttributeStaticValue, getAttributeValue, getChildren, getElementFullType, getElementSelfType, hasAnyAttribute, hasAttribute, hasChildren, hasEveryAttribute, isAttribute, isElement, isEmptyStringExpression, isFragmentElement, isHostElement, isPaddingWhitespace, isWhitespaceText, resolveAttributeValue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/jsx",
|
|
3
|
-
"version": "5.24.
|
|
3
|
+
"version": "5.24.5",
|
|
4
4
|
"description": "ESLint React's TSESTree JSX utility module for static analysis of JSX patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@eslint-react/ast": "5.24.
|
|
33
|
-
"@eslint-react/eslint": "5.24.
|
|
34
|
-
"@eslint-react/var": "5.24.
|
|
32
|
+
"@eslint-react/ast": "5.24.5",
|
|
33
|
+
"@eslint-react/eslint": "5.24.5",
|
|
34
|
+
"@eslint-react/var": "5.24.5",
|
|
35
35
|
"@typescript-eslint/types": "^8.71.0",
|
|
36
36
|
"@typescript-eslint/utils": "^8.71.0",
|
|
37
37
|
"ts-pattern": "^5.9.0"
|