@eslint-react/core 1.46.1-next.0 → 1.47.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.d.mts +179 -82
- package/dist/index.d.ts +179 -82
- package/dist/index.js +340 -94
- package/dist/index.mjs +324 -93
- package/package.json +6 -7
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var AST8 = require('@eslint-react/ast');
|
|
4
4
|
var eff = require('@eslint-react/eff');
|
|
5
|
-
var JSX3 = require('@eslint-react/jsx');
|
|
6
5
|
var kit = require('@eslint-react/kit');
|
|
7
6
|
var shared = require('@eslint-react/shared');
|
|
8
7
|
var types = require('@typescript-eslint/types');
|
|
9
|
-
var
|
|
8
|
+
var VAR3 = require('@eslint-react/var');
|
|
10
9
|
var tsPattern = require('ts-pattern');
|
|
11
10
|
var birecord = require('birecord');
|
|
12
11
|
|
|
@@ -30,9 +29,8 @@ function _interopNamespace(e) {
|
|
|
30
29
|
return Object.freeze(n);
|
|
31
30
|
}
|
|
32
31
|
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var VAR__namespace = /*#__PURE__*/_interopNamespace(VAR);
|
|
32
|
+
var AST8__namespace = /*#__PURE__*/_interopNamespace(AST8);
|
|
33
|
+
var VAR3__namespace = /*#__PURE__*/_interopNamespace(VAR3);
|
|
36
34
|
var birecord__default = /*#__PURE__*/_interopDefault(birecord);
|
|
37
35
|
|
|
38
36
|
var __defProp = Object.defineProperty;
|
|
@@ -1429,7 +1427,7 @@ function getRequireExpressionArguments(node) {
|
|
|
1429
1427
|
}
|
|
1430
1428
|
function isInitializedFromReact(name, importSource, initialScope) {
|
|
1431
1429
|
if (name.toLowerCase() === "react") return true;
|
|
1432
|
-
const latestDef =
|
|
1430
|
+
const latestDef = VAR3__namespace.findVariable(name, initialScope)?.defs.at(-1);
|
|
1433
1431
|
if (latestDef == null) return false;
|
|
1434
1432
|
const { node, parent } = latestDef;
|
|
1435
1433
|
if (node.type === types.AST_NODE_TYPES.VariableDeclarator && node.init != null) {
|
|
@@ -1442,7 +1440,7 @@ function isInitializedFromReact(name, importSource, initialScope) {
|
|
|
1442
1440
|
}
|
|
1443
1441
|
const args = getRequireExpressionArguments(init);
|
|
1444
1442
|
const arg0 = args?.[0];
|
|
1445
|
-
if (arg0 == null || !
|
|
1443
|
+
if (arg0 == null || !AST8__namespace.isLiteral(arg0, "string")) {
|
|
1446
1444
|
return false;
|
|
1447
1445
|
}
|
|
1448
1446
|
return arg0.value === importSource || arg0.value.startsWith(`${importSource}/`);
|
|
@@ -1507,7 +1505,7 @@ function isCallFromReactObject(objectName, propertyName) {
|
|
|
1507
1505
|
});
|
|
1508
1506
|
}
|
|
1509
1507
|
function isInstanceIdEqual(context, a, b) {
|
|
1510
|
-
return
|
|
1508
|
+
return AST8__namespace.isNodeEqual(a, b) || VAR3__namespace.isNodeValueEqual(a, b, [
|
|
1511
1509
|
context.sourceCode.getScope(a),
|
|
1512
1510
|
context.sourceCode.getScope(b)
|
|
1513
1511
|
]);
|
|
@@ -1552,10 +1550,10 @@ function isReactHookName(name) {
|
|
|
1552
1550
|
return name === "use" || /^use[A-Z0-9]/.test(name);
|
|
1553
1551
|
}
|
|
1554
1552
|
|
|
1555
|
-
// src/hook/is.ts
|
|
1553
|
+
// src/hook/hook-is.ts
|
|
1556
1554
|
function isReactHook(node) {
|
|
1557
1555
|
if (node == null) return false;
|
|
1558
|
-
const id =
|
|
1556
|
+
const id = AST8__namespace.getFunctionIdentifier(node);
|
|
1559
1557
|
return id?.name != null && isReactHookName(id.name);
|
|
1560
1558
|
}
|
|
1561
1559
|
function isReactHookCall(node) {
|
|
@@ -1653,23 +1651,12 @@ var isUseStateCall = eff.flip(isReactHookCallWithName)("useState");
|
|
|
1653
1651
|
var isUseSyncExternalStoreCall = eff.flip(isReactHookCallWithName)("useSyncExternalStore");
|
|
1654
1652
|
var isUseTransitionCall = eff.flip(isReactHookCallWithName)("useTransition");
|
|
1655
1653
|
|
|
1656
|
-
// src/hook/
|
|
1657
|
-
function isFunctionOfUseEffectSetup(node) {
|
|
1658
|
-
if (node == null) return false;
|
|
1659
|
-
return node.parent?.type === types.AST_NODE_TYPES.CallExpression && node.parent.callee !== node && node.parent.callee.type === types.AST_NODE_TYPES.Identifier && node.parent.arguments.at(0) === node && isUseEffectCallLoose(node.parent);
|
|
1660
|
-
}
|
|
1661
|
-
function isFunctionOfUseEffectCleanup(node) {
|
|
1662
|
-
if (node == null) return false;
|
|
1663
|
-
const returnStatement = AST6__namespace.findParentNode(node, AST6__namespace.is(types.AST_NODE_TYPES.ReturnStatement));
|
|
1664
|
-
const enclosingFunction = AST6__namespace.findParentNode(node, AST6__namespace.isFunction);
|
|
1665
|
-
const functionOfReturnStatement = AST6__namespace.findParentNode(returnStatement, AST6__namespace.isFunction);
|
|
1666
|
-
return enclosingFunction === functionOfReturnStatement && isFunctionOfUseEffectSetup(enclosingFunction);
|
|
1667
|
-
}
|
|
1654
|
+
// src/hook/hook-collector.ts
|
|
1668
1655
|
function useHookCollector() {
|
|
1669
1656
|
const hooks = /* @__PURE__ */ new Map();
|
|
1670
1657
|
const functionEntries = [];
|
|
1671
1658
|
const onFunctionEnter = (node) => {
|
|
1672
|
-
const id =
|
|
1659
|
+
const id = AST8__namespace.getFunctionIdentifier(node);
|
|
1673
1660
|
const key = shared.getId();
|
|
1674
1661
|
const name = id?.name;
|
|
1675
1662
|
if (name != null && isReactHookName(name)) {
|
|
@@ -1717,11 +1704,256 @@ function useHookCollector() {
|
|
|
1717
1704
|
};
|
|
1718
1705
|
return { ctx, listeners };
|
|
1719
1706
|
}
|
|
1707
|
+
function isFunctionOfUseEffectSetup(node) {
|
|
1708
|
+
if (node == null) return false;
|
|
1709
|
+
return node.parent?.type === types.AST_NODE_TYPES.CallExpression && node.parent.callee !== node && node.parent.callee.type === types.AST_NODE_TYPES.Identifier && node.parent.arguments.at(0) === node && isUseEffectCallLoose(node.parent);
|
|
1710
|
+
}
|
|
1711
|
+
function isFunctionOfUseEffectCleanup(node) {
|
|
1712
|
+
if (node == null) return false;
|
|
1713
|
+
const returnStatement = AST8__namespace.findParentNode(node, AST8__namespace.is(types.AST_NODE_TYPES.ReturnStatement));
|
|
1714
|
+
const enclosingFunction = AST8__namespace.findParentNode(node, AST8__namespace.isFunction);
|
|
1715
|
+
const functionOfReturnStatement = AST8__namespace.findParentNode(returnStatement, AST8__namespace.isFunction);
|
|
1716
|
+
return enclosingFunction === functionOfReturnStatement && isFunctionOfUseEffectSetup(enclosingFunction);
|
|
1717
|
+
}
|
|
1718
|
+
function stringifyJsx(node) {
|
|
1719
|
+
switch (node.type) {
|
|
1720
|
+
case types.AST_NODE_TYPES.JSXIdentifier:
|
|
1721
|
+
return node.name;
|
|
1722
|
+
case types.AST_NODE_TYPES.JSXNamespacedName:
|
|
1723
|
+
return `${node.namespace.name}:${node.name.name}`;
|
|
1724
|
+
case types.AST_NODE_TYPES.JSXMemberExpression:
|
|
1725
|
+
return `${stringifyJsx(node.object)}.${stringifyJsx(node.property)}`;
|
|
1726
|
+
case types.AST_NODE_TYPES.JSXText:
|
|
1727
|
+
return node.value;
|
|
1728
|
+
case types.AST_NODE_TYPES.JSXOpeningElement:
|
|
1729
|
+
return `<${stringifyJsx(node.name)}>`;
|
|
1730
|
+
case types.AST_NODE_TYPES.JSXClosingElement:
|
|
1731
|
+
return `</${stringifyJsx(node.name)}>`;
|
|
1732
|
+
case types.AST_NODE_TYPES.JSXOpeningFragment:
|
|
1733
|
+
return "<>";
|
|
1734
|
+
case types.AST_NODE_TYPES.JSXClosingFragment:
|
|
1735
|
+
return "</>";
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
// src/jsx/jsx-attribute-name.ts
|
|
1740
|
+
function getAttributeName(context, node) {
|
|
1741
|
+
return stringifyJsx(node.name);
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
// src/jsx/jsx-attribute.ts
|
|
1745
|
+
function getAttribute(context, name, attributes, initialScope) {
|
|
1746
|
+
return attributes.findLast((attr) => {
|
|
1747
|
+
if (attr.type === types.AST_NODE_TYPES.JSXAttribute) {
|
|
1748
|
+
return getAttributeName(context, attr) === name;
|
|
1749
|
+
}
|
|
1750
|
+
if (initialScope == null) return false;
|
|
1751
|
+
switch (attr.argument.type) {
|
|
1752
|
+
case types.AST_NODE_TYPES.Identifier: {
|
|
1753
|
+
const variable = VAR3__namespace.findVariable(attr.argument.name, initialScope);
|
|
1754
|
+
const variableNode = VAR3__namespace.getVariableInitNode(variable, 0);
|
|
1755
|
+
if (variableNode?.type === types.AST_NODE_TYPES.ObjectExpression) {
|
|
1756
|
+
return VAR3__namespace.findPropertyInProperties(name, variableNode.properties, initialScope) != null;
|
|
1757
|
+
}
|
|
1758
|
+
return false;
|
|
1759
|
+
}
|
|
1760
|
+
case types.AST_NODE_TYPES.ObjectExpression:
|
|
1761
|
+
return VAR3__namespace.findPropertyInProperties(name, attr.argument.properties, initialScope) != null;
|
|
1762
|
+
}
|
|
1763
|
+
return false;
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
function getAttributeValue(context, node, name) {
|
|
1767
|
+
const initialScope = context.sourceCode.getScope(node);
|
|
1768
|
+
switch (node.type) {
|
|
1769
|
+
case types.AST_NODE_TYPES.JSXAttribute:
|
|
1770
|
+
if (node.value?.type === types.AST_NODE_TYPES.Literal) {
|
|
1771
|
+
return {
|
|
1772
|
+
kind: "some",
|
|
1773
|
+
node: node.value,
|
|
1774
|
+
initialScope,
|
|
1775
|
+
value: node.value.value
|
|
1776
|
+
};
|
|
1777
|
+
}
|
|
1778
|
+
if (node.value?.type === types.AST_NODE_TYPES.JSXExpressionContainer) {
|
|
1779
|
+
return VAR3__namespace.toStaticValue({
|
|
1780
|
+
kind: "lazy",
|
|
1781
|
+
node: node.value.expression,
|
|
1782
|
+
initialScope
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
return { kind: "none", node, initialScope };
|
|
1786
|
+
case types.AST_NODE_TYPES.JSXSpreadAttribute: {
|
|
1787
|
+
const staticValue = VAR3__namespace.toStaticValue({
|
|
1788
|
+
kind: "lazy",
|
|
1789
|
+
node: node.argument,
|
|
1790
|
+
initialScope
|
|
1791
|
+
});
|
|
1792
|
+
if (staticValue.kind === "none") {
|
|
1793
|
+
return staticValue;
|
|
1794
|
+
}
|
|
1795
|
+
return tsPattern.match(staticValue.value).with({ [name]: tsPattern.P.select(tsPattern.P.any) }, (value) => ({
|
|
1796
|
+
kind: "some",
|
|
1797
|
+
node: node.argument,
|
|
1798
|
+
initialScope,
|
|
1799
|
+
value
|
|
1800
|
+
})).otherwise(() => ({ kind: "none", node, initialScope }));
|
|
1801
|
+
}
|
|
1802
|
+
default:
|
|
1803
|
+
return { kind: "none", node, initialScope };
|
|
1804
|
+
}
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
// src/jsx/jsx-detection-hint.ts
|
|
1808
|
+
var JSXDetectionHint = {
|
|
1809
|
+
None: 0n,
|
|
1810
|
+
SkipUndefined: 1n << 0n,
|
|
1811
|
+
SkipNullLiteral: 1n << 1n,
|
|
1812
|
+
SkipBooleanLiteral: 1n << 2n,
|
|
1813
|
+
SkipStringLiteral: 1n << 3n,
|
|
1814
|
+
SkipNumberLiteral: 1n << 4n,
|
|
1815
|
+
SkipBigIntLiteral: 1n << 5n,
|
|
1816
|
+
SkipEmptyArray: 1n << 6n,
|
|
1817
|
+
SkipCreateElement: 1n << 7n,
|
|
1818
|
+
StrictArray: 1n << 8n,
|
|
1819
|
+
StrictLogical: 1n << 9n,
|
|
1820
|
+
StrictConditional: 1n << 10n
|
|
1821
|
+
};
|
|
1822
|
+
var DEFAULT_JSX_DETECTION_HINT = 0n | JSXDetectionHint.SkipUndefined | JSXDetectionHint.SkipBooleanLiteral;
|
|
1823
|
+
|
|
1824
|
+
// src/jsx/jsx-detection.ts
|
|
1825
|
+
function isJsxText(node) {
|
|
1826
|
+
if (node == null) return false;
|
|
1827
|
+
return node.type === types.AST_NODE_TYPES.JSXText || node.type === types.AST_NODE_TYPES.Literal;
|
|
1828
|
+
}
|
|
1829
|
+
function isJsxLike(code, node, hint = DEFAULT_JSX_DETECTION_HINT) {
|
|
1830
|
+
if (node == null) return false;
|
|
1831
|
+
if (AST8__namespace.isJSX(node)) return true;
|
|
1832
|
+
switch (node.type) {
|
|
1833
|
+
case types.AST_NODE_TYPES.Literal: {
|
|
1834
|
+
switch (typeof node.value) {
|
|
1835
|
+
case "boolean":
|
|
1836
|
+
return !(hint & JSXDetectionHint.SkipBooleanLiteral);
|
|
1837
|
+
case "string":
|
|
1838
|
+
return !(hint & JSXDetectionHint.SkipStringLiteral);
|
|
1839
|
+
case "number":
|
|
1840
|
+
return !(hint & JSXDetectionHint.SkipNumberLiteral);
|
|
1841
|
+
case "bigint":
|
|
1842
|
+
return !(hint & JSXDetectionHint.SkipBigIntLiteral);
|
|
1843
|
+
}
|
|
1844
|
+
if (node.value == null) {
|
|
1845
|
+
return !(hint & JSXDetectionHint.SkipNullLiteral);
|
|
1846
|
+
}
|
|
1847
|
+
return false;
|
|
1848
|
+
}
|
|
1849
|
+
case types.AST_NODE_TYPES.TemplateLiteral: {
|
|
1850
|
+
return !(hint & JSXDetectionHint.SkipStringLiteral);
|
|
1851
|
+
}
|
|
1852
|
+
case types.AST_NODE_TYPES.ArrayExpression: {
|
|
1853
|
+
if (hint & JSXDetectionHint.StrictArray) {
|
|
1854
|
+
return node.elements.every((n) => isJsxLike(code, n, hint));
|
|
1855
|
+
}
|
|
1856
|
+
return node.elements.some((n) => isJsxLike(code, n, hint));
|
|
1857
|
+
}
|
|
1858
|
+
case types.AST_NODE_TYPES.LogicalExpression: {
|
|
1859
|
+
if (hint & JSXDetectionHint.StrictLogical) {
|
|
1860
|
+
return isJsxLike(code, node.left, hint) && isJsxLike(code, node.right, hint);
|
|
1861
|
+
}
|
|
1862
|
+
return isJsxLike(code, node.left, hint) || isJsxLike(code, node.right, hint);
|
|
1863
|
+
}
|
|
1864
|
+
case types.AST_NODE_TYPES.ConditionalExpression: {
|
|
1865
|
+
let leftHasJSX2 = function(node2) {
|
|
1866
|
+
if (Array.isArray(node2.consequent)) {
|
|
1867
|
+
if (node2.consequent.length === 0) {
|
|
1868
|
+
return !(hint & JSXDetectionHint.SkipEmptyArray);
|
|
1869
|
+
}
|
|
1870
|
+
if (hint & JSXDetectionHint.StrictArray) {
|
|
1871
|
+
return node2.consequent.every((n) => isJsxLike(code, n, hint));
|
|
1872
|
+
}
|
|
1873
|
+
return node2.consequent.some((n) => isJsxLike(code, n, hint));
|
|
1874
|
+
}
|
|
1875
|
+
return isJsxLike(code, node2.consequent, hint);
|
|
1876
|
+
}, rightHasJSX2 = function(node2) {
|
|
1877
|
+
return isJsxLike(code, node2.alternate, hint);
|
|
1878
|
+
};
|
|
1879
|
+
if (hint & JSXDetectionHint.StrictConditional) {
|
|
1880
|
+
return leftHasJSX2(node) && rightHasJSX2(node);
|
|
1881
|
+
}
|
|
1882
|
+
return leftHasJSX2(node) || rightHasJSX2(node);
|
|
1883
|
+
}
|
|
1884
|
+
case types.AST_NODE_TYPES.SequenceExpression: {
|
|
1885
|
+
const exp = node.expressions.at(-1);
|
|
1886
|
+
return isJsxLike(code, exp, hint);
|
|
1887
|
+
}
|
|
1888
|
+
case types.AST_NODE_TYPES.CallExpression: {
|
|
1889
|
+
if (hint & JSXDetectionHint.SkipCreateElement) {
|
|
1890
|
+
return false;
|
|
1891
|
+
}
|
|
1892
|
+
switch (node.callee.type) {
|
|
1893
|
+
case types.AST_NODE_TYPES.Identifier:
|
|
1894
|
+
return node.callee.name === "createElement";
|
|
1895
|
+
case types.AST_NODE_TYPES.MemberExpression:
|
|
1896
|
+
return node.callee.property.type === types.AST_NODE_TYPES.Identifier && node.callee.property.name === "createElement";
|
|
1897
|
+
}
|
|
1898
|
+
return false;
|
|
1899
|
+
}
|
|
1900
|
+
case types.AST_NODE_TYPES.Identifier: {
|
|
1901
|
+
const { name } = node;
|
|
1902
|
+
if (name === "undefined") {
|
|
1903
|
+
return !(hint & JSXDetectionHint.SkipUndefined);
|
|
1904
|
+
}
|
|
1905
|
+
if (AST8__namespace.isJSXTagNameExpression(node)) {
|
|
1906
|
+
return true;
|
|
1907
|
+
}
|
|
1908
|
+
const variable = VAR3__namespace.findVariable(name, code.getScope(node));
|
|
1909
|
+
const variableNode = variable && VAR3__namespace.getVariableInitNode(variable, 0);
|
|
1910
|
+
return !!variableNode && isJsxLike(code, variableNode, hint);
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
return false;
|
|
1914
|
+
}
|
|
1915
|
+
function getElementType(context, node) {
|
|
1916
|
+
if (node.type === types.AST_NODE_TYPES.JSXFragment) {
|
|
1917
|
+
return "";
|
|
1918
|
+
}
|
|
1919
|
+
return stringifyJsx(node.openingElement.name);
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
// src/jsx/jsx-has.ts
|
|
1923
|
+
function hasAttribute(context, name, attributes, initialScope) {
|
|
1924
|
+
return getAttribute(context, name, attributes, initialScope) != null;
|
|
1925
|
+
}
|
|
1926
|
+
function hasAnyAttribute(context, names, attributes, initialScope) {
|
|
1927
|
+
return names.some((n) => hasAttribute(context, n, attributes, initialScope));
|
|
1928
|
+
}
|
|
1929
|
+
function hasEveryAttribute(context, names, attributes, initialScope) {
|
|
1930
|
+
return names.every((n) => hasAttribute(context, n, attributes, initialScope));
|
|
1931
|
+
}
|
|
1932
|
+
function findParentAttribute(node, test = eff.constTrue) {
|
|
1933
|
+
const guard = (node2) => {
|
|
1934
|
+
return node2.type === types.AST_NODE_TYPES.JSXAttribute && test(node2);
|
|
1935
|
+
};
|
|
1936
|
+
return AST8__namespace.findParentNode(node, guard);
|
|
1937
|
+
}
|
|
1938
|
+
function isHostElement(context, node) {
|
|
1939
|
+
return node.type === types.AST_NODE_TYPES.JSXElement && node.openingElement.name.type === types.AST_NODE_TYPES.JSXIdentifier && /^[a-z]/u.test(node.openingElement.name.name);
|
|
1940
|
+
}
|
|
1941
|
+
function isKeyedElement(context, node, initialScope) {
|
|
1942
|
+
return node.type === types.AST_NODE_TYPES.JSXElement && hasAttribute(context, "key", node.openingElement.attributes, initialScope);
|
|
1943
|
+
}
|
|
1944
|
+
function isFragmentElement(context, node, allowJSXFragment = false) {
|
|
1945
|
+
if (node == null) return false;
|
|
1946
|
+
if (node.type !== types.AST_NODE_TYPES.JSXElement && node.type !== types.AST_NODE_TYPES.JSXFragment) return false;
|
|
1947
|
+
if (node.type === types.AST_NODE_TYPES.JSXFragment) return allowJSXFragment;
|
|
1948
|
+
return getElementType(context, node).split(".").at(-1) === "Fragment";
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
// src/component/component-detection-hint.ts
|
|
1720
1952
|
var ComponentDetectionHint = {
|
|
1721
1953
|
/**
|
|
1722
1954
|
* 1n << 0n - 1n << 63n are reserved for JSXDetectionHint
|
|
1723
1955
|
*/
|
|
1724
|
-
...
|
|
1956
|
+
...JSXDetectionHint,
|
|
1725
1957
|
/**
|
|
1726
1958
|
* Skip function component created by React.memo
|
|
1727
1959
|
*/
|
|
@@ -1748,85 +1980,83 @@ var ComponentDetectionHint = {
|
|
|
1748
1980
|
SkipClassProperty: 1n << 69n
|
|
1749
1981
|
};
|
|
1750
1982
|
var DEFAULT_COMPONENT_DETECTION_HINT = 0n | ComponentDetectionHint.SkipBooleanLiteral | ComponentDetectionHint.SkipEmptyArray | ComponentDetectionHint.SkipArrayMapArgument | ComponentDetectionHint.SkipNumberLiteral | ComponentDetectionHint.SkipStringLiteral | ComponentDetectionHint.SkipUndefined | ComponentDetectionHint.StrictArray | ComponentDetectionHint.StrictConditional | ComponentDetectionHint.StrictLogical;
|
|
1983
|
+
function isClassComponent(node) {
|
|
1984
|
+
if ("superClass" in node && node.superClass != null) {
|
|
1985
|
+
const re = /^(?:Pure)?Component$/u;
|
|
1986
|
+
switch (true) {
|
|
1987
|
+
case node.superClass.type === types.AST_NODE_TYPES.Identifier:
|
|
1988
|
+
return re.test(node.superClass.name);
|
|
1989
|
+
case (node.superClass.type === types.AST_NODE_TYPES.MemberExpression && node.superClass.property.type === types.AST_NODE_TYPES.Identifier):
|
|
1990
|
+
return re.test(node.superClass.property.name);
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
return false;
|
|
1994
|
+
}
|
|
1995
|
+
function isPureComponent(node) {
|
|
1996
|
+
if ("superClass" in node && node.superClass != null) {
|
|
1997
|
+
const re = /^PureComponent$/u;
|
|
1998
|
+
switch (true) {
|
|
1999
|
+
case node.superClass.type === types.AST_NODE_TYPES.Identifier:
|
|
2000
|
+
return re.test(node.superClass.name);
|
|
2001
|
+
case (node.superClass.type === types.AST_NODE_TYPES.MemberExpression && node.superClass.property.type === types.AST_NODE_TYPES.Identifier):
|
|
2002
|
+
return re.test(node.superClass.property.name);
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
return false;
|
|
2006
|
+
}
|
|
1751
2007
|
function isComponentDidCatch(node) {
|
|
1752
|
-
return
|
|
2008
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidCatch";
|
|
1753
2009
|
}
|
|
1754
2010
|
function isComponentDidMount(node) {
|
|
1755
|
-
return
|
|
2011
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
1756
2012
|
}
|
|
1757
2013
|
function isComponentDidUpdate(node) {
|
|
1758
|
-
return
|
|
2014
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
|
|
1759
2015
|
}
|
|
1760
2016
|
function isComponentWillMount(node) {
|
|
1761
|
-
return
|
|
2017
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillMount";
|
|
1762
2018
|
}
|
|
1763
2019
|
function isComponentWillReceiveProps(node) {
|
|
1764
|
-
return
|
|
2020
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillReceiveProps";
|
|
1765
2021
|
}
|
|
1766
2022
|
function isComponentWillUnmount(node) {
|
|
1767
|
-
return
|
|
2023
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUnmount";
|
|
1768
2024
|
}
|
|
1769
2025
|
function isComponentWillUpdate(node) {
|
|
1770
|
-
return
|
|
2026
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
1771
2027
|
}
|
|
1772
2028
|
function isGetChildContext(node) {
|
|
1773
|
-
return
|
|
2029
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "getChildContext";
|
|
1774
2030
|
}
|
|
1775
2031
|
function isGetDefaultProps(node) {
|
|
1776
|
-
return
|
|
2032
|
+
return AST8__namespace.isMethodOrProperty(node) && node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "getDefaultProps";
|
|
1777
2033
|
}
|
|
1778
2034
|
function isGetInitialState(node) {
|
|
1779
|
-
return
|
|
2035
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "getInitialState";
|
|
1780
2036
|
}
|
|
1781
2037
|
function isGetSnapshotBeforeUpdate(node) {
|
|
1782
|
-
return
|
|
2038
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "getSnapshotBeforeUpdate";
|
|
1783
2039
|
}
|
|
1784
2040
|
function isShouldComponentUpdate(node) {
|
|
1785
|
-
return
|
|
2041
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
|
|
1786
2042
|
}
|
|
1787
2043
|
function isUnsafeComponentWillMount(node) {
|
|
1788
|
-
return
|
|
2044
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
|
|
1789
2045
|
}
|
|
1790
2046
|
function isUnsafeComponentWillReceiveProps(node) {
|
|
1791
|
-
return
|
|
2047
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
|
|
1792
2048
|
}
|
|
1793
2049
|
function isUnsafeComponentWillUpdate(node) {
|
|
1794
|
-
return
|
|
2050
|
+
return AST8__namespace.isMethodOrProperty(node) && !node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
|
|
1795
2051
|
}
|
|
1796
2052
|
function isGetDerivedStateFromProps(node) {
|
|
1797
|
-
return
|
|
2053
|
+
return AST8__namespace.isMethodOrProperty(node) && node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromProps";
|
|
1798
2054
|
}
|
|
1799
2055
|
function isGetDerivedStateFromError(node) {
|
|
1800
|
-
return
|
|
2056
|
+
return AST8__namespace.isMethodOrProperty(node) && node.static && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromError";
|
|
1801
2057
|
}
|
|
1802
|
-
function isClassComponent(node) {
|
|
1803
|
-
if ("superClass" in node && node.superClass != null) {
|
|
1804
|
-
const re = /^(?:Pure)?Component$/u;
|
|
1805
|
-
switch (true) {
|
|
1806
|
-
case node.superClass.type === types.AST_NODE_TYPES.Identifier:
|
|
1807
|
-
return re.test(node.superClass.name);
|
|
1808
|
-
case (node.superClass.type === types.AST_NODE_TYPES.MemberExpression && node.superClass.property.type === types.AST_NODE_TYPES.Identifier):
|
|
1809
|
-
return re.test(node.superClass.property.name);
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
return false;
|
|
1813
|
-
}
|
|
1814
|
-
function isPureComponent(node) {
|
|
1815
|
-
if ("superClass" in node && node.superClass != null) {
|
|
1816
|
-
const re = /^PureComponent$/u;
|
|
1817
|
-
switch (true) {
|
|
1818
|
-
case node.superClass.type === types.AST_NODE_TYPES.Identifier:
|
|
1819
|
-
return re.test(node.superClass.name);
|
|
1820
|
-
case (node.superClass.type === types.AST_NODE_TYPES.MemberExpression && node.superClass.property.type === types.AST_NODE_TYPES.Identifier):
|
|
1821
|
-
return re.test(node.superClass.property.name);
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
return false;
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
// src/component/component-render.ts
|
|
1828
2058
|
function isRenderLike(node) {
|
|
1829
|
-
return
|
|
2059
|
+
return AST8__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name === "render" && node.parent.parent.type === types.AST_NODE_TYPES.ClassDeclaration;
|
|
1830
2060
|
}
|
|
1831
2061
|
function isFunctionOfRender(node) {
|
|
1832
2062
|
if (!isRenderLike(node.parent)) {
|
|
@@ -1835,10 +2065,10 @@ function isFunctionOfRender(node) {
|
|
|
1835
2065
|
return isClassComponent(node.parent.parent.parent);
|
|
1836
2066
|
}
|
|
1837
2067
|
function isRenderMethodLike(node) {
|
|
1838
|
-
return
|
|
2068
|
+
return AST8__namespace.isMethodOrProperty(node) && node.key.type === types.AST_NODE_TYPES.Identifier && node.key.name.startsWith("render") && node.parent.parent.type === types.AST_NODE_TYPES.ClassDeclaration;
|
|
1839
2069
|
}
|
|
1840
2070
|
|
|
1841
|
-
// src/component/hierarchy.ts
|
|
2071
|
+
// src/component/component-hierarchy.ts
|
|
1842
2072
|
function isChildrenOfCreateElement(context, node) {
|
|
1843
2073
|
const parent = node.parent;
|
|
1844
2074
|
if (parent == null || parent.type !== types.AST_NODE_TYPES.CallExpression) return false;
|
|
@@ -1846,13 +2076,13 @@ function isChildrenOfCreateElement(context, node) {
|
|
|
1846
2076
|
return parent.arguments.slice(2).some((arg) => arg === node);
|
|
1847
2077
|
}
|
|
1848
2078
|
function isInsideRenderMethod(node) {
|
|
1849
|
-
return
|
|
2079
|
+
return AST8__namespace.findParentNode(node, (n) => isRenderLike(n) && isClassComponent(n.parent.parent)) != null;
|
|
1850
2080
|
}
|
|
1851
2081
|
function isFunctionOfComponentDidMount(node) {
|
|
1852
|
-
return
|
|
2082
|
+
return AST8__namespace.isFunction(node) && isComponentDidMount(node.parent) && node.parent.value === node;
|
|
1853
2083
|
}
|
|
1854
2084
|
function isFunctionOfComponentWillUnmount(node) {
|
|
1855
|
-
return
|
|
2085
|
+
return AST8__namespace.isFunction(node) && isComponentWillUnmount(node.parent) && node.parent.value === node;
|
|
1856
2086
|
}
|
|
1857
2087
|
function isFunctionOfRenderMethod(node) {
|
|
1858
2088
|
if (!isRenderMethodLike(node.parent)) {
|
|
@@ -1892,12 +2122,12 @@ function isValidComponentDefinition(context, node, hint) {
|
|
|
1892
2122
|
if (hint & ComponentDetectionHint.SkipClassProperty && isFunctionOfClassProperty(node.parent)) {
|
|
1893
2123
|
return false;
|
|
1894
2124
|
}
|
|
1895
|
-
if (hint & ComponentDetectionHint.SkipArrayMapArgument &&
|
|
2125
|
+
if (hint & ComponentDetectionHint.SkipArrayMapArgument && AST8__namespace.isArrayMapCall(node.parent)) {
|
|
1896
2126
|
return false;
|
|
1897
2127
|
}
|
|
1898
|
-
const significantParent =
|
|
2128
|
+
const significantParent = AST8__namespace.findParentNode(
|
|
1899
2129
|
node,
|
|
1900
|
-
|
|
2130
|
+
AST8__namespace.isOneOf([
|
|
1901
2131
|
types.AST_NODE_TYPES.JSXExpressionContainer,
|
|
1902
2132
|
types.AST_NODE_TYPES.ArrowFunctionExpression,
|
|
1903
2133
|
types.AST_NODE_TYPES.FunctionExpression,
|
|
@@ -1918,7 +2148,7 @@ function isComponentWrapperCallLoose(context, node) {
|
|
|
1918
2148
|
|
|
1919
2149
|
// src/component/component-id.ts
|
|
1920
2150
|
function getFunctionComponentId(context, node) {
|
|
1921
|
-
const functionId =
|
|
2151
|
+
const functionId = AST8__namespace.getFunctionIdentifier(node);
|
|
1922
2152
|
if (functionId != null) {
|
|
1923
2153
|
return functionId;
|
|
1924
2154
|
}
|
|
@@ -1945,10 +2175,10 @@ var ComponentFlag = {
|
|
|
1945
2175
|
// src/component/component-init-path.ts
|
|
1946
2176
|
function getComponentFlagFromInitPath(initPath) {
|
|
1947
2177
|
let flag = ComponentFlag.None;
|
|
1948
|
-
if (initPath != null &&
|
|
2178
|
+
if (initPath != null && AST8__namespace.hasCallInFunctionInitPath("memo", initPath)) {
|
|
1949
2179
|
flag |= ComponentFlag.Memo;
|
|
1950
2180
|
}
|
|
1951
|
-
if (initPath != null &&
|
|
2181
|
+
if (initPath != null && AST8__namespace.hasCallInFunctionInitPath("forwardRef", initPath)) {
|
|
1952
2182
|
flag |= ComponentFlag.ForwardRef;
|
|
1953
2183
|
}
|
|
1954
2184
|
return flag;
|
|
@@ -1988,8 +2218,8 @@ function useComponentCollector(context, options = {}) {
|
|
|
1988
2218
|
const entry = functionEntries.at(-1);
|
|
1989
2219
|
if (entry == null) return;
|
|
1990
2220
|
if (!entry.isComponent) return functionEntries.pop();
|
|
1991
|
-
const shouldDrop =
|
|
1992
|
-
return context.sourceCode.getScope(r).block === entry.node && r.argument != null && !
|
|
2221
|
+
const shouldDrop = AST8__namespace.getNestedReturnStatements(entry.node.body).slice().reverse().some((r) => {
|
|
2222
|
+
return context.sourceCode.getScope(r).block === entry.node && r.argument != null && !isJsxLike(context.sourceCode, r.argument, hint);
|
|
1993
2223
|
});
|
|
1994
2224
|
if (shouldDrop) {
|
|
1995
2225
|
components.delete(entry.key);
|
|
@@ -2013,9 +2243,9 @@ function useComponentCollector(context, options = {}) {
|
|
|
2013
2243
|
const entry = getCurrentEntry();
|
|
2014
2244
|
if (entry == null) return;
|
|
2015
2245
|
const { body } = entry.node;
|
|
2016
|
-
const isComponent = hasNoneOrLooseComponentName(context, entry.node) &&
|
|
2246
|
+
const isComponent = hasNoneOrLooseComponentName(context, entry.node) && isJsxLike(context.sourceCode, body, hint) && isValidComponentDefinition(context, entry.node, hint);
|
|
2017
2247
|
if (!isComponent) return;
|
|
2018
|
-
const initPath =
|
|
2248
|
+
const initPath = AST8__namespace.getFunctionInitPath(entry.node);
|
|
2019
2249
|
const id = getFunctionComponentId(context, entry.node);
|
|
2020
2250
|
const name = getComponentNameFromId(id);
|
|
2021
2251
|
const key = shared.getId();
|
|
@@ -2053,10 +2283,10 @@ function useComponentCollector(context, options = {}) {
|
|
|
2053
2283
|
"ReturnStatement[type]"(node) {
|
|
2054
2284
|
const entry = getCurrentEntry();
|
|
2055
2285
|
if (entry == null) return;
|
|
2056
|
-
const isComponent = hasNoneOrLooseComponentName(context, entry.node) &&
|
|
2286
|
+
const isComponent = hasNoneOrLooseComponentName(context, entry.node) && isJsxLike(context.sourceCode, node.argument, hint) && isValidComponentDefinition(context, entry.node, hint);
|
|
2057
2287
|
if (!isComponent) return;
|
|
2058
2288
|
entry.isComponent = true;
|
|
2059
|
-
const initPath =
|
|
2289
|
+
const initPath = AST8__namespace.getFunctionInitPath(entry.node);
|
|
2060
2290
|
const id = getFunctionComponentId(context, entry.node);
|
|
2061
2291
|
const name = getComponentNameFromId(id);
|
|
2062
2292
|
components.set(entry.key, {
|
|
@@ -2087,7 +2317,7 @@ function useComponentCollectorLegacy() {
|
|
|
2087
2317
|
if (!isClassComponent(node)) {
|
|
2088
2318
|
return;
|
|
2089
2319
|
}
|
|
2090
|
-
const id =
|
|
2320
|
+
const id = AST8__namespace.getClassIdentifier(node);
|
|
2091
2321
|
const key = shared.getId();
|
|
2092
2322
|
const flag = isPureComponent(node) ? ComponentFlag.PureComponent : ComponentFlag.None;
|
|
2093
2323
|
components.set(
|
|
@@ -2120,20 +2350,20 @@ var ComponentPhaseRelevance = birecord__default.default({
|
|
|
2120
2350
|
var isInversePhase = eff.dual(2, (a, b) => ComponentPhaseRelevance.get(a) === b);
|
|
2121
2351
|
function isRenderFunctionLoose(context, node) {
|
|
2122
2352
|
const { body, parent } = node;
|
|
2123
|
-
if (
|
|
2353
|
+
if (AST8__namespace.getFunctionIdentifier(node)?.name.startsWith("render")) {
|
|
2124
2354
|
return parent.type === types.AST_NODE_TYPES.JSXExpressionContainer && parent.parent.type === types.AST_NODE_TYPES.JSXAttribute && parent.parent.name.type === types.AST_NODE_TYPES.JSXIdentifier && parent.parent.name.name.startsWith("render");
|
|
2125
2355
|
}
|
|
2126
|
-
return
|
|
2356
|
+
return isJsxLike(
|
|
2127
2357
|
context.sourceCode,
|
|
2128
2358
|
body,
|
|
2129
|
-
|
|
2359
|
+
JSXDetectionHint.SkipNullLiteral | JSXDetectionHint.SkipUndefined | JSXDetectionHint.StrictLogical | JSXDetectionHint.StrictConditional
|
|
2130
2360
|
);
|
|
2131
2361
|
}
|
|
2132
2362
|
function isRenderPropLoose(context, node) {
|
|
2133
2363
|
if (node.name.type !== types.AST_NODE_TYPES.JSXIdentifier) {
|
|
2134
2364
|
return false;
|
|
2135
2365
|
}
|
|
2136
|
-
return node.name.name.startsWith("render") && node.value?.type === types.AST_NODE_TYPES.JSXExpressionContainer &&
|
|
2366
|
+
return node.name.name.startsWith("render") && node.value?.type === types.AST_NODE_TYPES.JSXExpressionContainer && AST8__namespace.isFunction(node.value.expression) && isRenderFunctionLoose(context, node.value.expression);
|
|
2137
2367
|
}
|
|
2138
2368
|
function isDirectValueOfRenderPropertyLoose(node) {
|
|
2139
2369
|
const matching = (node2) => {
|
|
@@ -2145,7 +2375,7 @@ function isDeclaredInRenderPropLoose(node) {
|
|
|
2145
2375
|
if (isDirectValueOfRenderPropertyLoose(node)) {
|
|
2146
2376
|
return true;
|
|
2147
2377
|
}
|
|
2148
|
-
const parent =
|
|
2378
|
+
const parent = AST8__namespace.findParentNode(node, AST8__namespace.is(types.AST_NODE_TYPES.JSXExpressionContainer))?.parent;
|
|
2149
2379
|
if (parent?.type !== types.AST_NODE_TYPES.JSXAttribute) {
|
|
2150
2380
|
return false;
|
|
2151
2381
|
}
|
|
@@ -2153,21 +2383,31 @@ function isDeclaredInRenderPropLoose(node) {
|
|
|
2153
2383
|
}
|
|
2154
2384
|
function isThisSetState(node) {
|
|
2155
2385
|
const { callee } = node;
|
|
2156
|
-
return callee.type === types.AST_NODE_TYPES.MemberExpression &&
|
|
2386
|
+
return callee.type === types.AST_NODE_TYPES.MemberExpression && AST8__namespace.isThisExpression(callee.object) && callee.property.type === types.AST_NODE_TYPES.Identifier && callee.property.name === "setState";
|
|
2157
2387
|
}
|
|
2158
2388
|
function isAssignmentToThisState(node) {
|
|
2159
2389
|
const { left } = node;
|
|
2160
|
-
return left.type === types.AST_NODE_TYPES.MemberExpression &&
|
|
2390
|
+
return left.type === types.AST_NODE_TYPES.MemberExpression && AST8__namespace.isThisExpression(left.object) && AST8__namespace.getPropertyName(left.property) === "state";
|
|
2161
2391
|
}
|
|
2162
2392
|
|
|
2163
2393
|
exports.ComponentDetectionHint = ComponentDetectionHint;
|
|
2164
2394
|
exports.ComponentFlag = ComponentFlag;
|
|
2165
2395
|
exports.ComponentPhaseRelevance = ComponentPhaseRelevance;
|
|
2166
2396
|
exports.DEFAULT_COMPONENT_DETECTION_HINT = DEFAULT_COMPONENT_DETECTION_HINT;
|
|
2397
|
+
exports.DEFAULT_JSX_DETECTION_HINT = DEFAULT_JSX_DETECTION_HINT;
|
|
2398
|
+
exports.JSXDetectionHint = JSXDetectionHint;
|
|
2399
|
+
exports.findParentAttribute = findParentAttribute;
|
|
2400
|
+
exports.getAttribute = getAttribute;
|
|
2401
|
+
exports.getAttributeName = getAttributeName;
|
|
2402
|
+
exports.getAttributeValue = getAttributeValue;
|
|
2167
2403
|
exports.getComponentFlagFromInitPath = getComponentFlagFromInitPath;
|
|
2168
2404
|
exports.getComponentNameFromId = getComponentNameFromId;
|
|
2405
|
+
exports.getElementType = getElementType;
|
|
2169
2406
|
exports.getFunctionComponentId = getFunctionComponentId;
|
|
2170
2407
|
exports.getInstanceId = getInstanceId;
|
|
2408
|
+
exports.hasAnyAttribute = hasAnyAttribute;
|
|
2409
|
+
exports.hasAttribute = hasAttribute;
|
|
2410
|
+
exports.hasEveryAttribute = hasEveryAttribute;
|
|
2171
2411
|
exports.hasNoneOrLooseComponentName = hasNoneOrLooseComponentName;
|
|
2172
2412
|
exports.isAssignmentToThisState = isAssignmentToThisState;
|
|
2173
2413
|
exports.isCallFromReact = isCallFromReact;
|
|
@@ -2209,6 +2449,7 @@ exports.isDeclaredInRenderPropLoose = isDeclaredInRenderPropLoose;
|
|
|
2209
2449
|
exports.isDirectValueOfRenderPropertyLoose = isDirectValueOfRenderPropertyLoose;
|
|
2210
2450
|
exports.isForwardRef = isForwardRef;
|
|
2211
2451
|
exports.isForwardRefCall = isForwardRefCall;
|
|
2452
|
+
exports.isFragmentElement = isFragmentElement;
|
|
2212
2453
|
exports.isFromReact = isFromReact;
|
|
2213
2454
|
exports.isFromReactLoose = isFromReactLoose;
|
|
2214
2455
|
exports.isFromReactObject = isFromReactObject;
|
|
@@ -2225,10 +2466,14 @@ exports.isGetDerivedStateFromError = isGetDerivedStateFromError;
|
|
|
2225
2466
|
exports.isGetDerivedStateFromProps = isGetDerivedStateFromProps;
|
|
2226
2467
|
exports.isGetInitialState = isGetInitialState;
|
|
2227
2468
|
exports.isGetSnapshotBeforeUpdate = isGetSnapshotBeforeUpdate;
|
|
2469
|
+
exports.isHostElement = isHostElement;
|
|
2228
2470
|
exports.isInitializedFromReact = isInitializedFromReact;
|
|
2229
2471
|
exports.isInsideRenderMethod = isInsideRenderMethod;
|
|
2230
2472
|
exports.isInstanceIdEqual = isInstanceIdEqual;
|
|
2231
2473
|
exports.isInversePhase = isInversePhase;
|
|
2474
|
+
exports.isJsxLike = isJsxLike;
|
|
2475
|
+
exports.isJsxText = isJsxText;
|
|
2476
|
+
exports.isKeyedElement = isKeyedElement;
|
|
2232
2477
|
exports.isLazy = isLazy;
|
|
2233
2478
|
exports.isLazyCall = isLazyCall;
|
|
2234
2479
|
exports.isMemo = isMemo;
|
|
@@ -2272,6 +2517,7 @@ exports.isUseStateCall = isUseStateCall;
|
|
|
2272
2517
|
exports.isUseSyncExternalStoreCall = isUseSyncExternalStoreCall;
|
|
2273
2518
|
exports.isUseTransitionCall = isUseTransitionCall;
|
|
2274
2519
|
exports.isValidComponentDefinition = isValidComponentDefinition;
|
|
2520
|
+
exports.stringifyJsx = stringifyJsx;
|
|
2275
2521
|
exports.useComponentCollector = useComponentCollector;
|
|
2276
2522
|
exports.useComponentCollectorLegacy = useComponentCollectorLegacy;
|
|
2277
2523
|
exports.useHookCollector = useHookCollector;
|