@eslint-react/core 1.46.1-next.0 → 1.47.0-next.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.d.mts +181 -82
- package/dist/index.d.ts +181 -82
- package/dist/index.js +358 -94
- package/dist/index.mjs +341 -93
- package/package.json +6 -7
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { flip, dual, constFalse, identity, _ } from '@eslint-react/eff';
|
|
3
|
-
import * as JSX3 from '@eslint-react/jsx';
|
|
1
|
+
import * as AST8 from '@eslint-react/ast';
|
|
2
|
+
import { flip, dual, constFalse, identity, constTrue, _ } from '@eslint-react/eff';
|
|
4
3
|
import { RE, SEL } from '@eslint-react/kit';
|
|
5
4
|
import { DEFAULT_ESLINT_REACT_SETTINGS as DEFAULT_ESLINT_REACT_SETTINGS$1, unsafeDecodeSettings, getId } from '@eslint-react/shared';
|
|
6
5
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
7
|
-
import * as
|
|
6
|
+
import * as VAR3 from '@eslint-react/var';
|
|
8
7
|
import { isMatching, P, match } from 'ts-pattern';
|
|
9
8
|
import birecord from 'birecord';
|
|
10
9
|
|
|
@@ -1402,7 +1401,7 @@ function getRequireExpressionArguments(node) {
|
|
|
1402
1401
|
}
|
|
1403
1402
|
function isInitializedFromReact(name, importSource, initialScope) {
|
|
1404
1403
|
if (name.toLowerCase() === "react") return true;
|
|
1405
|
-
const latestDef =
|
|
1404
|
+
const latestDef = VAR3.findVariable(name, initialScope)?.defs.at(-1);
|
|
1406
1405
|
if (latestDef == null) return false;
|
|
1407
1406
|
const { node, parent } = latestDef;
|
|
1408
1407
|
if (node.type === AST_NODE_TYPES.VariableDeclarator && node.init != null) {
|
|
@@ -1415,7 +1414,7 @@ function isInitializedFromReact(name, importSource, initialScope) {
|
|
|
1415
1414
|
}
|
|
1416
1415
|
const args = getRequireExpressionArguments(init);
|
|
1417
1416
|
const arg0 = args?.[0];
|
|
1418
|
-
if (arg0 == null || !
|
|
1417
|
+
if (arg0 == null || !AST8.isLiteral(arg0, "string")) {
|
|
1419
1418
|
return false;
|
|
1420
1419
|
}
|
|
1421
1420
|
return arg0.value === importSource || arg0.value.startsWith(`${importSource}/`);
|
|
@@ -1480,7 +1479,7 @@ function isCallFromReactObject(objectName, propertyName) {
|
|
|
1480
1479
|
});
|
|
1481
1480
|
}
|
|
1482
1481
|
function isInstanceIdEqual(context, a, b) {
|
|
1483
|
-
return
|
|
1482
|
+
return AST8.isNodeEqual(a, b) || VAR3.isNodeValueEqual(a, b, [
|
|
1484
1483
|
context.sourceCode.getScope(a),
|
|
1485
1484
|
context.sourceCode.getScope(b)
|
|
1486
1485
|
]);
|
|
@@ -1525,10 +1524,10 @@ function isReactHookName(name) {
|
|
|
1525
1524
|
return name === "use" || /^use[A-Z0-9]/.test(name);
|
|
1526
1525
|
}
|
|
1527
1526
|
|
|
1528
|
-
// src/hook/is.ts
|
|
1527
|
+
// src/hook/hook-is.ts
|
|
1529
1528
|
function isReactHook(node) {
|
|
1530
1529
|
if (node == null) return false;
|
|
1531
|
-
const id =
|
|
1530
|
+
const id = AST8.getFunctionIdentifier(node);
|
|
1532
1531
|
return id?.name != null && isReactHookName(id.name);
|
|
1533
1532
|
}
|
|
1534
1533
|
function isReactHookCall(node) {
|
|
@@ -1626,23 +1625,12 @@ var isUseStateCall = flip(isReactHookCallWithName)("useState");
|
|
|
1626
1625
|
var isUseSyncExternalStoreCall = flip(isReactHookCallWithName)("useSyncExternalStore");
|
|
1627
1626
|
var isUseTransitionCall = flip(isReactHookCallWithName)("useTransition");
|
|
1628
1627
|
|
|
1629
|
-
// src/hook/
|
|
1630
|
-
function isFunctionOfUseEffectSetup(node) {
|
|
1631
|
-
if (node == null) return false;
|
|
1632
|
-
return node.parent?.type === AST_NODE_TYPES.CallExpression && node.parent.callee !== node && node.parent.callee.type === AST_NODE_TYPES.Identifier && node.parent.arguments.at(0) === node && isUseEffectCallLoose(node.parent);
|
|
1633
|
-
}
|
|
1634
|
-
function isFunctionOfUseEffectCleanup(node) {
|
|
1635
|
-
if (node == null) return false;
|
|
1636
|
-
const returnStatement = AST6.findParentNode(node, AST6.is(AST_NODE_TYPES.ReturnStatement));
|
|
1637
|
-
const enclosingFunction = AST6.findParentNode(node, AST6.isFunction);
|
|
1638
|
-
const functionOfReturnStatement = AST6.findParentNode(returnStatement, AST6.isFunction);
|
|
1639
|
-
return enclosingFunction === functionOfReturnStatement && isFunctionOfUseEffectSetup(enclosingFunction);
|
|
1640
|
-
}
|
|
1628
|
+
// src/hook/hook-collector.ts
|
|
1641
1629
|
function useHookCollector() {
|
|
1642
1630
|
const hooks = /* @__PURE__ */ new Map();
|
|
1643
1631
|
const functionEntries = [];
|
|
1644
1632
|
const onFunctionEnter = (node) => {
|
|
1645
|
-
const id =
|
|
1633
|
+
const id = AST8.getFunctionIdentifier(node);
|
|
1646
1634
|
const key = getId();
|
|
1647
1635
|
const name = id?.name;
|
|
1648
1636
|
if (name != null && isReactHookName(name)) {
|
|
@@ -1690,11 +1678,273 @@ function useHookCollector() {
|
|
|
1690
1678
|
};
|
|
1691
1679
|
return { ctx, listeners };
|
|
1692
1680
|
}
|
|
1681
|
+
function isFunctionOfUseEffectSetup(node) {
|
|
1682
|
+
if (node == null) return false;
|
|
1683
|
+
return node.parent?.type === AST_NODE_TYPES.CallExpression && node.parent.callee !== node && node.parent.callee.type === AST_NODE_TYPES.Identifier && node.parent.arguments.at(0) === node && isUseEffectCallLoose(node.parent);
|
|
1684
|
+
}
|
|
1685
|
+
function isFunctionOfUseEffectCleanup(node) {
|
|
1686
|
+
if (node == null) return false;
|
|
1687
|
+
const returnStatement = AST8.findParentNode(node, AST8.is(AST_NODE_TYPES.ReturnStatement));
|
|
1688
|
+
const enclosingFunction = AST8.findParentNode(node, AST8.isFunction);
|
|
1689
|
+
const functionOfReturnStatement = AST8.findParentNode(returnStatement, AST8.isFunction);
|
|
1690
|
+
return enclosingFunction === functionOfReturnStatement && isFunctionOfUseEffectSetup(enclosingFunction);
|
|
1691
|
+
}
|
|
1692
|
+
function stringifyJsx(node) {
|
|
1693
|
+
switch (node.type) {
|
|
1694
|
+
case AST_NODE_TYPES.JSXIdentifier:
|
|
1695
|
+
return node.name;
|
|
1696
|
+
case AST_NODE_TYPES.JSXNamespacedName:
|
|
1697
|
+
return `${node.namespace.name}:${node.name.name}`;
|
|
1698
|
+
case AST_NODE_TYPES.JSXMemberExpression:
|
|
1699
|
+
return `${stringifyJsx(node.object)}.${stringifyJsx(node.property)}`;
|
|
1700
|
+
case AST_NODE_TYPES.JSXText:
|
|
1701
|
+
return node.value;
|
|
1702
|
+
case AST_NODE_TYPES.JSXOpeningElement:
|
|
1703
|
+
return `<${stringifyJsx(node.name)}>`;
|
|
1704
|
+
case AST_NODE_TYPES.JSXClosingElement:
|
|
1705
|
+
return `</${stringifyJsx(node.name)}>`;
|
|
1706
|
+
case AST_NODE_TYPES.JSXOpeningFragment:
|
|
1707
|
+
return "<>";
|
|
1708
|
+
case AST_NODE_TYPES.JSXClosingFragment:
|
|
1709
|
+
return "</>";
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
// src/jsx/jsx-attribute-name.ts
|
|
1714
|
+
function getAttributeName(context, node) {
|
|
1715
|
+
return stringifyJsx(node.name);
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
// src/jsx/jsx-attribute.ts
|
|
1719
|
+
function getAttribute(context, name, attributes, initialScope) {
|
|
1720
|
+
return attributes.findLast((attr) => {
|
|
1721
|
+
if (attr.type === AST_NODE_TYPES.JSXAttribute) {
|
|
1722
|
+
return getAttributeName(context, attr) === name;
|
|
1723
|
+
}
|
|
1724
|
+
if (initialScope == null) return false;
|
|
1725
|
+
switch (attr.argument.type) {
|
|
1726
|
+
case AST_NODE_TYPES.Identifier: {
|
|
1727
|
+
const variable = VAR3.findVariable(attr.argument.name, initialScope);
|
|
1728
|
+
const variableNode = VAR3.getVariableInitNode(variable, 0);
|
|
1729
|
+
if (variableNode?.type === AST_NODE_TYPES.ObjectExpression) {
|
|
1730
|
+
return VAR3.findPropertyInProperties(name, variableNode.properties, initialScope) != null;
|
|
1731
|
+
}
|
|
1732
|
+
return false;
|
|
1733
|
+
}
|
|
1734
|
+
case AST_NODE_TYPES.ObjectExpression:
|
|
1735
|
+
return VAR3.findPropertyInProperties(name, attr.argument.properties, initialScope) != null;
|
|
1736
|
+
}
|
|
1737
|
+
return false;
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
function getAttributeValue(context, node, name) {
|
|
1741
|
+
const initialScope = context.sourceCode.getScope(node);
|
|
1742
|
+
switch (node.type) {
|
|
1743
|
+
case AST_NODE_TYPES.JSXAttribute:
|
|
1744
|
+
if (node.value?.type === AST_NODE_TYPES.Literal) {
|
|
1745
|
+
return {
|
|
1746
|
+
kind: "some",
|
|
1747
|
+
node: node.value,
|
|
1748
|
+
initialScope,
|
|
1749
|
+
value: node.value.value
|
|
1750
|
+
};
|
|
1751
|
+
}
|
|
1752
|
+
if (node.value?.type === AST_NODE_TYPES.JSXExpressionContainer) {
|
|
1753
|
+
return VAR3.toStaticValue({
|
|
1754
|
+
kind: "lazy",
|
|
1755
|
+
node: node.value.expression,
|
|
1756
|
+
initialScope
|
|
1757
|
+
});
|
|
1758
|
+
}
|
|
1759
|
+
return { kind: "none", node, initialScope };
|
|
1760
|
+
case AST_NODE_TYPES.JSXSpreadAttribute: {
|
|
1761
|
+
const staticValue = VAR3.toStaticValue({
|
|
1762
|
+
kind: "lazy",
|
|
1763
|
+
node: node.argument,
|
|
1764
|
+
initialScope
|
|
1765
|
+
});
|
|
1766
|
+
if (staticValue.kind === "none") {
|
|
1767
|
+
return staticValue;
|
|
1768
|
+
}
|
|
1769
|
+
return match(staticValue.value).with({ [name]: P.select(P.any) }, (value) => ({
|
|
1770
|
+
kind: "some",
|
|
1771
|
+
node: node.argument,
|
|
1772
|
+
initialScope,
|
|
1773
|
+
value
|
|
1774
|
+
})).otherwise(() => ({ kind: "none", node, initialScope }));
|
|
1775
|
+
}
|
|
1776
|
+
default:
|
|
1777
|
+
return { kind: "none", node, initialScope };
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
// src/jsx/jsx-detection-hint.ts
|
|
1782
|
+
var JSXDetectionHint = {
|
|
1783
|
+
None: 0n,
|
|
1784
|
+
SkipUndefined: 1n << 0n,
|
|
1785
|
+
SkipNullLiteral: 1n << 1n,
|
|
1786
|
+
SkipBooleanLiteral: 1n << 2n,
|
|
1787
|
+
SkipStringLiteral: 1n << 3n,
|
|
1788
|
+
SkipNumberLiteral: 1n << 4n,
|
|
1789
|
+
SkipBigIntLiteral: 1n << 5n,
|
|
1790
|
+
SkipEmptyArray: 1n << 6n,
|
|
1791
|
+
SkipCreateElement: 1n << 7n,
|
|
1792
|
+
StrictArray: 1n << 8n,
|
|
1793
|
+
StrictLogical: 1n << 9n,
|
|
1794
|
+
StrictConditional: 1n << 10n
|
|
1795
|
+
};
|
|
1796
|
+
var DEFAULT_JSX_DETECTION_HINT = 0n | JSXDetectionHint.SkipUndefined | JSXDetectionHint.SkipBooleanLiteral;
|
|
1797
|
+
|
|
1798
|
+
// src/jsx/jsx-detection.ts
|
|
1799
|
+
var isJSX = AST8.isOneOf([
|
|
1800
|
+
AST_NODE_TYPES.JSXAttribute,
|
|
1801
|
+
AST_NODE_TYPES.JSXClosingElement,
|
|
1802
|
+
AST_NODE_TYPES.JSXClosingFragment,
|
|
1803
|
+
AST_NODE_TYPES.JSXElement,
|
|
1804
|
+
AST_NODE_TYPES.JSXEmptyExpression,
|
|
1805
|
+
AST_NODE_TYPES.JSXExpressionContainer,
|
|
1806
|
+
AST_NODE_TYPES.JSXFragment,
|
|
1807
|
+
AST_NODE_TYPES.JSXIdentifier,
|
|
1808
|
+
AST_NODE_TYPES.JSXMemberExpression,
|
|
1809
|
+
AST_NODE_TYPES.JSXNamespacedName,
|
|
1810
|
+
AST_NODE_TYPES.JSXOpeningElement,
|
|
1811
|
+
AST_NODE_TYPES.JSXOpeningFragment,
|
|
1812
|
+
AST_NODE_TYPES.JSXSpreadAttribute,
|
|
1813
|
+
AST_NODE_TYPES.JSXSpreadChild,
|
|
1814
|
+
AST_NODE_TYPES.JSXText
|
|
1815
|
+
]);
|
|
1816
|
+
function isJsxText(node) {
|
|
1817
|
+
if (node == null) return false;
|
|
1818
|
+
return node.type === AST_NODE_TYPES.JSXText || node.type === AST_NODE_TYPES.Literal;
|
|
1819
|
+
}
|
|
1820
|
+
function isJsxLike(code, node, hint = DEFAULT_JSX_DETECTION_HINT) {
|
|
1821
|
+
if (node == null) return false;
|
|
1822
|
+
if (isJSX(node)) return true;
|
|
1823
|
+
switch (node.type) {
|
|
1824
|
+
case AST_NODE_TYPES.Literal: {
|
|
1825
|
+
switch (typeof node.value) {
|
|
1826
|
+
case "boolean":
|
|
1827
|
+
return !(hint & JSXDetectionHint.SkipBooleanLiteral);
|
|
1828
|
+
case "string":
|
|
1829
|
+
return !(hint & JSXDetectionHint.SkipStringLiteral);
|
|
1830
|
+
case "number":
|
|
1831
|
+
return !(hint & JSXDetectionHint.SkipNumberLiteral);
|
|
1832
|
+
case "bigint":
|
|
1833
|
+
return !(hint & JSXDetectionHint.SkipBigIntLiteral);
|
|
1834
|
+
}
|
|
1835
|
+
if (node.value == null) {
|
|
1836
|
+
return !(hint & JSXDetectionHint.SkipNullLiteral);
|
|
1837
|
+
}
|
|
1838
|
+
return false;
|
|
1839
|
+
}
|
|
1840
|
+
case AST_NODE_TYPES.TemplateLiteral: {
|
|
1841
|
+
return !(hint & JSXDetectionHint.SkipStringLiteral);
|
|
1842
|
+
}
|
|
1843
|
+
case AST_NODE_TYPES.ArrayExpression: {
|
|
1844
|
+
if (hint & JSXDetectionHint.StrictArray) {
|
|
1845
|
+
return node.elements.every((n) => isJsxLike(code, n, hint));
|
|
1846
|
+
}
|
|
1847
|
+
return node.elements.some((n) => isJsxLike(code, n, hint));
|
|
1848
|
+
}
|
|
1849
|
+
case AST_NODE_TYPES.LogicalExpression: {
|
|
1850
|
+
if (hint & JSXDetectionHint.StrictLogical) {
|
|
1851
|
+
return isJsxLike(code, node.left, hint) && isJsxLike(code, node.right, hint);
|
|
1852
|
+
}
|
|
1853
|
+
return isJsxLike(code, node.left, hint) || isJsxLike(code, node.right, hint);
|
|
1854
|
+
}
|
|
1855
|
+
case AST_NODE_TYPES.ConditionalExpression: {
|
|
1856
|
+
let leftHasJSX2 = function(node2) {
|
|
1857
|
+
if (Array.isArray(node2.consequent)) {
|
|
1858
|
+
if (node2.consequent.length === 0) {
|
|
1859
|
+
return !(hint & JSXDetectionHint.SkipEmptyArray);
|
|
1860
|
+
}
|
|
1861
|
+
if (hint & JSXDetectionHint.StrictArray) {
|
|
1862
|
+
return node2.consequent.every((n) => isJsxLike(code, n, hint));
|
|
1863
|
+
}
|
|
1864
|
+
return node2.consequent.some((n) => isJsxLike(code, n, hint));
|
|
1865
|
+
}
|
|
1866
|
+
return isJsxLike(code, node2.consequent, hint);
|
|
1867
|
+
}, rightHasJSX2 = function(node2) {
|
|
1868
|
+
return isJsxLike(code, node2.alternate, hint);
|
|
1869
|
+
};
|
|
1870
|
+
if (hint & JSXDetectionHint.StrictConditional) {
|
|
1871
|
+
return leftHasJSX2(node) && rightHasJSX2(node);
|
|
1872
|
+
}
|
|
1873
|
+
return leftHasJSX2(node) || rightHasJSX2(node);
|
|
1874
|
+
}
|
|
1875
|
+
case AST_NODE_TYPES.SequenceExpression: {
|
|
1876
|
+
const exp = node.expressions.at(-1);
|
|
1877
|
+
return isJsxLike(code, exp, hint);
|
|
1878
|
+
}
|
|
1879
|
+
case AST_NODE_TYPES.CallExpression: {
|
|
1880
|
+
if (hint & JSXDetectionHint.SkipCreateElement) {
|
|
1881
|
+
return false;
|
|
1882
|
+
}
|
|
1883
|
+
switch (node.callee.type) {
|
|
1884
|
+
case AST_NODE_TYPES.Identifier:
|
|
1885
|
+
return node.callee.name === "createElement";
|
|
1886
|
+
case AST_NODE_TYPES.MemberExpression:
|
|
1887
|
+
return node.callee.property.type === AST_NODE_TYPES.Identifier && node.callee.property.name === "createElement";
|
|
1888
|
+
}
|
|
1889
|
+
return false;
|
|
1890
|
+
}
|
|
1891
|
+
case AST_NODE_TYPES.Identifier: {
|
|
1892
|
+
const { name } = node;
|
|
1893
|
+
if (name === "undefined") {
|
|
1894
|
+
return !(hint & JSXDetectionHint.SkipUndefined);
|
|
1895
|
+
}
|
|
1896
|
+
if (AST8.isJSXTagNameExpression(node)) {
|
|
1897
|
+
return true;
|
|
1898
|
+
}
|
|
1899
|
+
const variable = VAR3.findVariable(name, code.getScope(node));
|
|
1900
|
+
const variableNode = variable && VAR3.getVariableInitNode(variable, 0);
|
|
1901
|
+
return !!variableNode && isJsxLike(code, variableNode, hint);
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
return false;
|
|
1905
|
+
}
|
|
1906
|
+
function getElementType(context, node) {
|
|
1907
|
+
if (node.type === AST_NODE_TYPES.JSXFragment) {
|
|
1908
|
+
return "";
|
|
1909
|
+
}
|
|
1910
|
+
return stringifyJsx(node.openingElement.name);
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
// src/jsx/jsx-has.ts
|
|
1914
|
+
function hasAttribute(context, name, attributes, initialScope) {
|
|
1915
|
+
return getAttribute(context, name, attributes, initialScope) != null;
|
|
1916
|
+
}
|
|
1917
|
+
function hasAnyAttribute(context, names, attributes, initialScope) {
|
|
1918
|
+
return names.some((n) => hasAttribute(context, n, attributes, initialScope));
|
|
1919
|
+
}
|
|
1920
|
+
function hasEveryAttribute(context, names, attributes, initialScope) {
|
|
1921
|
+
return names.every((n) => hasAttribute(context, n, attributes, initialScope));
|
|
1922
|
+
}
|
|
1923
|
+
function findParentAttribute(node, test = constTrue) {
|
|
1924
|
+
const guard = (node2) => {
|
|
1925
|
+
return node2.type === AST_NODE_TYPES.JSXAttribute && test(node2);
|
|
1926
|
+
};
|
|
1927
|
+
return AST8.findParentNode(node, guard);
|
|
1928
|
+
}
|
|
1929
|
+
function isHostElement(context, node) {
|
|
1930
|
+
return node.type === AST_NODE_TYPES.JSXElement && node.openingElement.name.type === AST_NODE_TYPES.JSXIdentifier && /^[a-z]/u.test(node.openingElement.name.name);
|
|
1931
|
+
}
|
|
1932
|
+
function isKeyedElement(context, node, initialScope) {
|
|
1933
|
+
return node.type === AST_NODE_TYPES.JSXElement && hasAttribute(context, "key", node.openingElement.attributes, initialScope);
|
|
1934
|
+
}
|
|
1935
|
+
function isFragmentElement(context, node, allowJSXFragment = false) {
|
|
1936
|
+
if (node == null) return false;
|
|
1937
|
+
if (node.type !== AST_NODE_TYPES.JSXElement && node.type !== AST_NODE_TYPES.JSXFragment) return false;
|
|
1938
|
+
if (node.type === AST_NODE_TYPES.JSXFragment) return allowJSXFragment;
|
|
1939
|
+
return getElementType(context, node).split(".").at(-1) === "Fragment";
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
// src/component/component-detection-hint.ts
|
|
1693
1943
|
var ComponentDetectionHint = {
|
|
1694
1944
|
/**
|
|
1695
1945
|
* 1n << 0n - 1n << 63n are reserved for JSXDetectionHint
|
|
1696
1946
|
*/
|
|
1697
|
-
...
|
|
1947
|
+
...JSXDetectionHint,
|
|
1698
1948
|
/**
|
|
1699
1949
|
* Skip function component created by React.memo
|
|
1700
1950
|
*/
|
|
@@ -1721,85 +1971,83 @@ var ComponentDetectionHint = {
|
|
|
1721
1971
|
SkipClassProperty: 1n << 69n
|
|
1722
1972
|
};
|
|
1723
1973
|
var DEFAULT_COMPONENT_DETECTION_HINT = 0n | ComponentDetectionHint.SkipBooleanLiteral | ComponentDetectionHint.SkipEmptyArray | ComponentDetectionHint.SkipArrayMapArgument | ComponentDetectionHint.SkipNumberLiteral | ComponentDetectionHint.SkipStringLiteral | ComponentDetectionHint.SkipUndefined | ComponentDetectionHint.StrictArray | ComponentDetectionHint.StrictConditional | ComponentDetectionHint.StrictLogical;
|
|
1974
|
+
function isClassComponent(node) {
|
|
1975
|
+
if ("superClass" in node && node.superClass != null) {
|
|
1976
|
+
const re = /^(?:Pure)?Component$/u;
|
|
1977
|
+
switch (true) {
|
|
1978
|
+
case node.superClass.type === AST_NODE_TYPES.Identifier:
|
|
1979
|
+
return re.test(node.superClass.name);
|
|
1980
|
+
case (node.superClass.type === AST_NODE_TYPES.MemberExpression && node.superClass.property.type === AST_NODE_TYPES.Identifier):
|
|
1981
|
+
return re.test(node.superClass.property.name);
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
return false;
|
|
1985
|
+
}
|
|
1986
|
+
function isPureComponent(node) {
|
|
1987
|
+
if ("superClass" in node && node.superClass != null) {
|
|
1988
|
+
const re = /^PureComponent$/u;
|
|
1989
|
+
switch (true) {
|
|
1990
|
+
case node.superClass.type === AST_NODE_TYPES.Identifier:
|
|
1991
|
+
return re.test(node.superClass.name);
|
|
1992
|
+
case (node.superClass.type === AST_NODE_TYPES.MemberExpression && node.superClass.property.type === AST_NODE_TYPES.Identifier):
|
|
1993
|
+
return re.test(node.superClass.property.name);
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
return false;
|
|
1997
|
+
}
|
|
1724
1998
|
function isComponentDidCatch(node) {
|
|
1725
|
-
return
|
|
1999
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidCatch";
|
|
1726
2000
|
}
|
|
1727
2001
|
function isComponentDidMount(node) {
|
|
1728
|
-
return
|
|
2002
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
1729
2003
|
}
|
|
1730
2004
|
function isComponentDidUpdate(node) {
|
|
1731
|
-
return
|
|
2005
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidUpdate";
|
|
1732
2006
|
}
|
|
1733
2007
|
function isComponentWillMount(node) {
|
|
1734
|
-
return
|
|
2008
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillMount";
|
|
1735
2009
|
}
|
|
1736
2010
|
function isComponentWillReceiveProps(node) {
|
|
1737
|
-
return
|
|
2011
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillReceiveProps";
|
|
1738
2012
|
}
|
|
1739
2013
|
function isComponentWillUnmount(node) {
|
|
1740
|
-
return
|
|
2014
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUnmount";
|
|
1741
2015
|
}
|
|
1742
2016
|
function isComponentWillUpdate(node) {
|
|
1743
|
-
return
|
|
2017
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUpdate";
|
|
1744
2018
|
}
|
|
1745
2019
|
function isGetChildContext(node) {
|
|
1746
|
-
return
|
|
2020
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getChildContext";
|
|
1747
2021
|
}
|
|
1748
2022
|
function isGetDefaultProps(node) {
|
|
1749
|
-
return
|
|
2023
|
+
return AST8.isMethodOrProperty(node) && node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getDefaultProps";
|
|
1750
2024
|
}
|
|
1751
2025
|
function isGetInitialState(node) {
|
|
1752
|
-
return
|
|
2026
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getInitialState";
|
|
1753
2027
|
}
|
|
1754
2028
|
function isGetSnapshotBeforeUpdate(node) {
|
|
1755
|
-
return
|
|
2029
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getSnapshotBeforeUpdate";
|
|
1756
2030
|
}
|
|
1757
2031
|
function isShouldComponentUpdate(node) {
|
|
1758
|
-
return
|
|
2032
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "shouldComponentUpdate";
|
|
1759
2033
|
}
|
|
1760
2034
|
function isUnsafeComponentWillMount(node) {
|
|
1761
|
-
return
|
|
2035
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillMount";
|
|
1762
2036
|
}
|
|
1763
2037
|
function isUnsafeComponentWillReceiveProps(node) {
|
|
1764
|
-
return
|
|
2038
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillReceiveProps";
|
|
1765
2039
|
}
|
|
1766
2040
|
function isUnsafeComponentWillUpdate(node) {
|
|
1767
|
-
return
|
|
2041
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "UNSAFE_componentWillUpdate";
|
|
1768
2042
|
}
|
|
1769
2043
|
function isGetDerivedStateFromProps(node) {
|
|
1770
|
-
return
|
|
2044
|
+
return AST8.isMethodOrProperty(node) && node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromProps";
|
|
1771
2045
|
}
|
|
1772
2046
|
function isGetDerivedStateFromError(node) {
|
|
1773
|
-
return
|
|
2047
|
+
return AST8.isMethodOrProperty(node) && node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromError";
|
|
1774
2048
|
}
|
|
1775
|
-
function isClassComponent(node) {
|
|
1776
|
-
if ("superClass" in node && node.superClass != null) {
|
|
1777
|
-
const re = /^(?:Pure)?Component$/u;
|
|
1778
|
-
switch (true) {
|
|
1779
|
-
case node.superClass.type === AST_NODE_TYPES.Identifier:
|
|
1780
|
-
return re.test(node.superClass.name);
|
|
1781
|
-
case (node.superClass.type === AST_NODE_TYPES.MemberExpression && node.superClass.property.type === AST_NODE_TYPES.Identifier):
|
|
1782
|
-
return re.test(node.superClass.property.name);
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
return false;
|
|
1786
|
-
}
|
|
1787
|
-
function isPureComponent(node) {
|
|
1788
|
-
if ("superClass" in node && node.superClass != null) {
|
|
1789
|
-
const re = /^PureComponent$/u;
|
|
1790
|
-
switch (true) {
|
|
1791
|
-
case node.superClass.type === AST_NODE_TYPES.Identifier:
|
|
1792
|
-
return re.test(node.superClass.name);
|
|
1793
|
-
case (node.superClass.type === AST_NODE_TYPES.MemberExpression && node.superClass.property.type === AST_NODE_TYPES.Identifier):
|
|
1794
|
-
return re.test(node.superClass.property.name);
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
return false;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
// src/component/component-render.ts
|
|
1801
2049
|
function isRenderLike(node) {
|
|
1802
|
-
return
|
|
2050
|
+
return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "render" && node.parent.parent.type === AST_NODE_TYPES.ClassDeclaration;
|
|
1803
2051
|
}
|
|
1804
2052
|
function isFunctionOfRender(node) {
|
|
1805
2053
|
if (!isRenderLike(node.parent)) {
|
|
@@ -1808,10 +2056,10 @@ function isFunctionOfRender(node) {
|
|
|
1808
2056
|
return isClassComponent(node.parent.parent.parent);
|
|
1809
2057
|
}
|
|
1810
2058
|
function isRenderMethodLike(node) {
|
|
1811
|
-
return
|
|
2059
|
+
return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name.startsWith("render") && node.parent.parent.type === AST_NODE_TYPES.ClassDeclaration;
|
|
1812
2060
|
}
|
|
1813
2061
|
|
|
1814
|
-
// src/component/hierarchy.ts
|
|
2062
|
+
// src/component/component-hierarchy.ts
|
|
1815
2063
|
function isChildrenOfCreateElement(context, node) {
|
|
1816
2064
|
const parent = node.parent;
|
|
1817
2065
|
if (parent == null || parent.type !== AST_NODE_TYPES.CallExpression) return false;
|
|
@@ -1819,13 +2067,13 @@ function isChildrenOfCreateElement(context, node) {
|
|
|
1819
2067
|
return parent.arguments.slice(2).some((arg) => arg === node);
|
|
1820
2068
|
}
|
|
1821
2069
|
function isInsideRenderMethod(node) {
|
|
1822
|
-
return
|
|
2070
|
+
return AST8.findParentNode(node, (n) => isRenderLike(n) && isClassComponent(n.parent.parent)) != null;
|
|
1823
2071
|
}
|
|
1824
2072
|
function isFunctionOfComponentDidMount(node) {
|
|
1825
|
-
return
|
|
2073
|
+
return AST8.isFunction(node) && isComponentDidMount(node.parent) && node.parent.value === node;
|
|
1826
2074
|
}
|
|
1827
2075
|
function isFunctionOfComponentWillUnmount(node) {
|
|
1828
|
-
return
|
|
2076
|
+
return AST8.isFunction(node) && isComponentWillUnmount(node.parent) && node.parent.value === node;
|
|
1829
2077
|
}
|
|
1830
2078
|
function isFunctionOfRenderMethod(node) {
|
|
1831
2079
|
if (!isRenderMethodLike(node.parent)) {
|
|
@@ -1865,12 +2113,12 @@ function isValidComponentDefinition(context, node, hint) {
|
|
|
1865
2113
|
if (hint & ComponentDetectionHint.SkipClassProperty && isFunctionOfClassProperty(node.parent)) {
|
|
1866
2114
|
return false;
|
|
1867
2115
|
}
|
|
1868
|
-
if (hint & ComponentDetectionHint.SkipArrayMapArgument &&
|
|
2116
|
+
if (hint & ComponentDetectionHint.SkipArrayMapArgument && AST8.isArrayMapCall(node.parent)) {
|
|
1869
2117
|
return false;
|
|
1870
2118
|
}
|
|
1871
|
-
const significantParent =
|
|
2119
|
+
const significantParent = AST8.findParentNode(
|
|
1872
2120
|
node,
|
|
1873
|
-
|
|
2121
|
+
AST8.isOneOf([
|
|
1874
2122
|
AST_NODE_TYPES.JSXExpressionContainer,
|
|
1875
2123
|
AST_NODE_TYPES.ArrowFunctionExpression,
|
|
1876
2124
|
AST_NODE_TYPES.FunctionExpression,
|
|
@@ -1891,7 +2139,7 @@ function isComponentWrapperCallLoose(context, node) {
|
|
|
1891
2139
|
|
|
1892
2140
|
// src/component/component-id.ts
|
|
1893
2141
|
function getFunctionComponentId(context, node) {
|
|
1894
|
-
const functionId =
|
|
2142
|
+
const functionId = AST8.getFunctionIdentifier(node);
|
|
1895
2143
|
if (functionId != null) {
|
|
1896
2144
|
return functionId;
|
|
1897
2145
|
}
|
|
@@ -1918,10 +2166,10 @@ var ComponentFlag = {
|
|
|
1918
2166
|
// src/component/component-init-path.ts
|
|
1919
2167
|
function getComponentFlagFromInitPath(initPath) {
|
|
1920
2168
|
let flag = ComponentFlag.None;
|
|
1921
|
-
if (initPath != null &&
|
|
2169
|
+
if (initPath != null && AST8.hasCallInFunctionInitPath("memo", initPath)) {
|
|
1922
2170
|
flag |= ComponentFlag.Memo;
|
|
1923
2171
|
}
|
|
1924
|
-
if (initPath != null &&
|
|
2172
|
+
if (initPath != null && AST8.hasCallInFunctionInitPath("forwardRef", initPath)) {
|
|
1925
2173
|
flag |= ComponentFlag.ForwardRef;
|
|
1926
2174
|
}
|
|
1927
2175
|
return flag;
|
|
@@ -1961,8 +2209,8 @@ function useComponentCollector(context, options = {}) {
|
|
|
1961
2209
|
const entry = functionEntries.at(-1);
|
|
1962
2210
|
if (entry == null) return;
|
|
1963
2211
|
if (!entry.isComponent) return functionEntries.pop();
|
|
1964
|
-
const shouldDrop =
|
|
1965
|
-
return context.sourceCode.getScope(r).block === entry.node && r.argument != null && !
|
|
2212
|
+
const shouldDrop = AST8.getNestedReturnStatements(entry.node.body).slice().reverse().some((r) => {
|
|
2213
|
+
return context.sourceCode.getScope(r).block === entry.node && r.argument != null && !isJsxLike(context.sourceCode, r.argument, hint);
|
|
1966
2214
|
});
|
|
1967
2215
|
if (shouldDrop) {
|
|
1968
2216
|
components.delete(entry.key);
|
|
@@ -1986,9 +2234,9 @@ function useComponentCollector(context, options = {}) {
|
|
|
1986
2234
|
const entry = getCurrentEntry();
|
|
1987
2235
|
if (entry == null) return;
|
|
1988
2236
|
const { body } = entry.node;
|
|
1989
|
-
const isComponent = hasNoneOrLooseComponentName(context, entry.node) &&
|
|
2237
|
+
const isComponent = hasNoneOrLooseComponentName(context, entry.node) && isJsxLike(context.sourceCode, body, hint) && isValidComponentDefinition(context, entry.node, hint);
|
|
1990
2238
|
if (!isComponent) return;
|
|
1991
|
-
const initPath =
|
|
2239
|
+
const initPath = AST8.getFunctionInitPath(entry.node);
|
|
1992
2240
|
const id = getFunctionComponentId(context, entry.node);
|
|
1993
2241
|
const name = getComponentNameFromId(id);
|
|
1994
2242
|
const key = getId();
|
|
@@ -2026,10 +2274,10 @@ function useComponentCollector(context, options = {}) {
|
|
|
2026
2274
|
"ReturnStatement[type]"(node) {
|
|
2027
2275
|
const entry = getCurrentEntry();
|
|
2028
2276
|
if (entry == null) return;
|
|
2029
|
-
const isComponent = hasNoneOrLooseComponentName(context, entry.node) &&
|
|
2277
|
+
const isComponent = hasNoneOrLooseComponentName(context, entry.node) && isJsxLike(context.sourceCode, node.argument, hint) && isValidComponentDefinition(context, entry.node, hint);
|
|
2030
2278
|
if (!isComponent) return;
|
|
2031
2279
|
entry.isComponent = true;
|
|
2032
|
-
const initPath =
|
|
2280
|
+
const initPath = AST8.getFunctionInitPath(entry.node);
|
|
2033
2281
|
const id = getFunctionComponentId(context, entry.node);
|
|
2034
2282
|
const name = getComponentNameFromId(id);
|
|
2035
2283
|
components.set(entry.key, {
|
|
@@ -2060,7 +2308,7 @@ function useComponentCollectorLegacy() {
|
|
|
2060
2308
|
if (!isClassComponent(node)) {
|
|
2061
2309
|
return;
|
|
2062
2310
|
}
|
|
2063
|
-
const id =
|
|
2311
|
+
const id = AST8.getClassIdentifier(node);
|
|
2064
2312
|
const key = getId();
|
|
2065
2313
|
const flag = isPureComponent(node) ? ComponentFlag.PureComponent : ComponentFlag.None;
|
|
2066
2314
|
components.set(
|
|
@@ -2093,20 +2341,20 @@ var ComponentPhaseRelevance = birecord({
|
|
|
2093
2341
|
var isInversePhase = dual(2, (a, b) => ComponentPhaseRelevance.get(a) === b);
|
|
2094
2342
|
function isRenderFunctionLoose(context, node) {
|
|
2095
2343
|
const { body, parent } = node;
|
|
2096
|
-
if (
|
|
2344
|
+
if (AST8.getFunctionIdentifier(node)?.name.startsWith("render")) {
|
|
2097
2345
|
return parent.type === AST_NODE_TYPES.JSXExpressionContainer && parent.parent.type === AST_NODE_TYPES.JSXAttribute && parent.parent.name.type === AST_NODE_TYPES.JSXIdentifier && parent.parent.name.name.startsWith("render");
|
|
2098
2346
|
}
|
|
2099
|
-
return
|
|
2347
|
+
return isJsxLike(
|
|
2100
2348
|
context.sourceCode,
|
|
2101
2349
|
body,
|
|
2102
|
-
|
|
2350
|
+
JSXDetectionHint.SkipNullLiteral | JSXDetectionHint.SkipUndefined | JSXDetectionHint.StrictLogical | JSXDetectionHint.StrictConditional
|
|
2103
2351
|
);
|
|
2104
2352
|
}
|
|
2105
2353
|
function isRenderPropLoose(context, node) {
|
|
2106
2354
|
if (node.name.type !== AST_NODE_TYPES.JSXIdentifier) {
|
|
2107
2355
|
return false;
|
|
2108
2356
|
}
|
|
2109
|
-
return node.name.name.startsWith("render") && node.value?.type === AST_NODE_TYPES.JSXExpressionContainer &&
|
|
2357
|
+
return node.name.name.startsWith("render") && node.value?.type === AST_NODE_TYPES.JSXExpressionContainer && AST8.isFunction(node.value.expression) && isRenderFunctionLoose(context, node.value.expression);
|
|
2110
2358
|
}
|
|
2111
2359
|
function isDirectValueOfRenderPropertyLoose(node) {
|
|
2112
2360
|
const matching = (node2) => {
|
|
@@ -2118,7 +2366,7 @@ function isDeclaredInRenderPropLoose(node) {
|
|
|
2118
2366
|
if (isDirectValueOfRenderPropertyLoose(node)) {
|
|
2119
2367
|
return true;
|
|
2120
2368
|
}
|
|
2121
|
-
const parent =
|
|
2369
|
+
const parent = AST8.findParentNode(node, AST8.is(AST_NODE_TYPES.JSXExpressionContainer))?.parent;
|
|
2122
2370
|
if (parent?.type !== AST_NODE_TYPES.JSXAttribute) {
|
|
2123
2371
|
return false;
|
|
2124
2372
|
}
|
|
@@ -2126,11 +2374,11 @@ function isDeclaredInRenderPropLoose(node) {
|
|
|
2126
2374
|
}
|
|
2127
2375
|
function isThisSetState(node) {
|
|
2128
2376
|
const { callee } = node;
|
|
2129
|
-
return callee.type === AST_NODE_TYPES.MemberExpression &&
|
|
2377
|
+
return callee.type === AST_NODE_TYPES.MemberExpression && AST8.isThisExpression(callee.object) && callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "setState";
|
|
2130
2378
|
}
|
|
2131
2379
|
function isAssignmentToThisState(node) {
|
|
2132
2380
|
const { left } = node;
|
|
2133
|
-
return left.type === AST_NODE_TYPES.MemberExpression &&
|
|
2381
|
+
return left.type === AST_NODE_TYPES.MemberExpression && AST8.isThisExpression(left.object) && AST8.getPropertyName(left.property) === "state";
|
|
2134
2382
|
}
|
|
2135
2383
|
|
|
2136
|
-
export { ComponentDetectionHint, ComponentFlag, ComponentPhaseRelevance, DEFAULT_COMPONENT_DETECTION_HINT, getComponentFlagFromInitPath, getComponentNameFromId, getFunctionComponentId, getInstanceId, hasNoneOrLooseComponentName, isAssignmentToThisState, isCallFromReact, isCallFromReactObject, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentDidUpdate, isComponentName, isComponentNameLoose, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUpdate, isComponentWrapperCall, isComponentWrapperCallLoose, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactLoose, isFromReactObject, isFromReactStrict, isFunctionOfComponentDidMount, isFunctionOfComponentWillUnmount, isFunctionOfRender, isFunctionOfRenderMethod, isFunctionOfUseEffectCleanup, isFunctionOfUseEffectSetup, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isInitializedFromReact, isInsideRenderMethod, isInstanceIdEqual, isInversePhase, isLazy, isLazyCall, isMemo, isMemoCall, isPureComponent, isReactAPI, isReactAPICall, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderLike, isRenderMethodLike, isRenderPropLoose, isShouldComponentUpdate, isThisSetState, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUseActionStateCall, isUseCall, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseFormStatusCall, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseOptimisticCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, isValidComponentDefinition, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
|
2384
|
+
export { ComponentDetectionHint, ComponentFlag, ComponentPhaseRelevance, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, JSXDetectionHint, findParentAttribute, getAttribute, getAttributeName, getAttributeValue, getComponentFlagFromInitPath, getComponentNameFromId, getElementType, getFunctionComponentId, getInstanceId, hasAnyAttribute, hasAttribute, hasEveryAttribute, hasNoneOrLooseComponentName, isAssignmentToThisState, isCallFromReact, isCallFromReactObject, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentDidUpdate, isComponentName, isComponentNameLoose, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUpdate, isComponentWrapperCall, isComponentWrapperCallLoose, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFragmentElement, isFromReact, isFromReactLoose, isFromReactObject, isFromReactStrict, isFunctionOfComponentDidMount, isFunctionOfComponentWillUnmount, isFunctionOfRender, isFunctionOfRenderMethod, isFunctionOfUseEffectCleanup, isFunctionOfUseEffectSetup, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isHostElement, isInitializedFromReact, isInsideRenderMethod, isInstanceIdEqual, isInversePhase, isJSX, isJsxLike, isJsxText, isKeyedElement, isLazy, isLazyCall, isMemo, isMemoCall, isPureComponent, isReactAPI, isReactAPICall, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderLike, isRenderMethodLike, isRenderPropLoose, isShouldComponentUpdate, isThisSetState, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUseActionStateCall, isUseCall, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseFormStatusCall, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseOptimisticCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, isValidComponentDefinition, stringifyJsx, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|