@eslint-react/core 1.24.0-next.1 → 1.24.0-next.12
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 +145 -136
- package/dist/index.d.ts +145 -136
- package/dist/index.js +112 -122
- package/dist/index.mjs +102 -117
- package/package.json +11 -11
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
import * as AST8 from '@eslint-react/ast';
|
|
2
|
-
import { flip,
|
|
3
|
-
import * as
|
|
2
|
+
import { flip, dual, _, returnFalse } from '@eslint-react/eff';
|
|
3
|
+
import * as JSX3 from '@eslint-react/jsx';
|
|
4
4
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
5
|
-
import * as VAR from '@eslint-react/var';
|
|
6
5
|
import { unsafeDecodeSettings } from '@eslint-react/shared';
|
|
6
|
+
import * as VAR from '@eslint-react/var';
|
|
7
|
+
import birecord from 'birecord';
|
|
7
8
|
|
|
8
9
|
// src/component/component-collector.ts
|
|
9
|
-
function getElementNameAndRepresentName(node, context, polymorphicPropName, additionalComponents = []) {
|
|
10
|
-
const name = JSX4.getElementName(node);
|
|
11
|
-
if (name === name.toLowerCase()) return [name, name];
|
|
12
|
-
const component = additionalComponents.findLast((c) => c.name === name || c.re.test(name));
|
|
13
|
-
if (component != null) return [name, component.as];
|
|
14
|
-
if (polymorphicPropName == null) return [name, name];
|
|
15
|
-
const initialScope = context.sourceCode.getScope(node);
|
|
16
|
-
const polymorphicProp = JSX4.findPropInAttributes(
|
|
17
|
-
polymorphicPropName,
|
|
18
|
-
initialScope,
|
|
19
|
-
node.attributes
|
|
20
|
-
);
|
|
21
|
-
if (polymorphicProp == null) return [name, name];
|
|
22
|
-
const polymorphicName = VAR.toResolved(JSX4.getPropValue(polymorphicProp, initialScope)).value;
|
|
23
|
-
if (typeof polymorphicName === "string") {
|
|
24
|
-
return [name, polymorphicName];
|
|
25
|
-
}
|
|
26
|
-
return [name, name];
|
|
27
|
-
}
|
|
28
10
|
|
|
29
11
|
// src/utils/get-id.ts
|
|
30
12
|
var id = 0n;
|
|
@@ -140,9 +122,9 @@ var isMemoCall = isReactAPICallWithName("memo");
|
|
|
140
122
|
|
|
141
123
|
// src/element/hierarchy.ts
|
|
142
124
|
function isInsideCreateElementProps(node, context) {
|
|
143
|
-
const call = AST8.
|
|
125
|
+
const call = AST8.findParentNode(node, isCreateElementCall(context));
|
|
144
126
|
if (call == null) return false;
|
|
145
|
-
const prop = AST8.
|
|
127
|
+
const prop = AST8.findParentNode(node, AST8.is(AST_NODE_TYPES.ObjectExpression));
|
|
146
128
|
if (prop == null) return false;
|
|
147
129
|
return prop === call.arguments[1];
|
|
148
130
|
}
|
|
@@ -252,7 +234,7 @@ var isUseTransitionCall = flip(isReactHookCallWithName)("useTransition");
|
|
|
252
234
|
|
|
253
235
|
// src/hook/hierarchy.ts
|
|
254
236
|
function isInsideReactHook(node) {
|
|
255
|
-
return isReactHook(AST8.
|
|
237
|
+
return isReactHook(AST8.findParentNode(node, AST8.isFunction));
|
|
256
238
|
}
|
|
257
239
|
function useHookCollector() {
|
|
258
240
|
const hooks = /* @__PURE__ */ new Map();
|
|
@@ -264,8 +246,8 @@ function useHookCollector() {
|
|
|
264
246
|
const key = getId();
|
|
265
247
|
fEntries.push({ key, node });
|
|
266
248
|
hooks.set(key, {
|
|
267
|
-
_: key,
|
|
268
249
|
id: id2,
|
|
250
|
+
key,
|
|
269
251
|
kind: "function",
|
|
270
252
|
name,
|
|
271
253
|
node,
|
|
@@ -304,19 +286,13 @@ function useHookCollector() {
|
|
|
304
286
|
if (hook == null) {
|
|
305
287
|
return;
|
|
306
288
|
}
|
|
307
|
-
|
|
308
|
-
...hook,
|
|
309
|
-
hookCalls: [
|
|
310
|
-
...hook.hookCalls,
|
|
311
|
-
node
|
|
312
|
-
]
|
|
313
|
-
});
|
|
289
|
+
hook.hookCalls.push(node);
|
|
314
290
|
}
|
|
315
291
|
};
|
|
316
292
|
return { ctx, listeners };
|
|
317
293
|
}
|
|
318
294
|
var ERComponentHint = {
|
|
319
|
-
...
|
|
295
|
+
...JSX3.JSXValueHint,
|
|
320
296
|
// 1n << 0n - 1n << 63n are reserved for JSXValueHint
|
|
321
297
|
// Skip function component created by React.memo
|
|
322
298
|
SkipMemo: 1n << 64n,
|
|
@@ -371,14 +347,6 @@ function getFunctionComponentIdentifier(node, context) {
|
|
|
371
347
|
}
|
|
372
348
|
return _;
|
|
373
349
|
}
|
|
374
|
-
var RE_COMPONENT_NAME = /^_?[A-Z]/u;
|
|
375
|
-
function getComponentNameFromIdentifier(node) {
|
|
376
|
-
if (node == null) return _;
|
|
377
|
-
return Array.isArray(node) ? node.map((n) => n.name).join(".") : node.name;
|
|
378
|
-
}
|
|
379
|
-
function isComponentName(name) {
|
|
380
|
-
return RE_COMPONENT_NAME.test(name);
|
|
381
|
-
}
|
|
382
350
|
function isClassComponent(node) {
|
|
383
351
|
if ("superClass" in node && node.superClass != null) {
|
|
384
352
|
const re = /^(?:Pure)?Component$/u;
|
|
@@ -404,9 +372,30 @@ function isPureComponent(node) {
|
|
|
404
372
|
return false;
|
|
405
373
|
}
|
|
406
374
|
|
|
407
|
-
// src/component/component-
|
|
375
|
+
// src/component/component-lifecycle.ts
|
|
376
|
+
function isComponentDidMount(node) {
|
|
377
|
+
return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
378
|
+
}
|
|
379
|
+
function isComponentWillUnmount(node) {
|
|
380
|
+
return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUnmount";
|
|
381
|
+
}
|
|
382
|
+
function isComponentDidCatch(node) {
|
|
383
|
+
return AST8.isMethodOrProperty(node) && !node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidCatch";
|
|
384
|
+
}
|
|
385
|
+
function isGetDerivedStateFromError(node) {
|
|
386
|
+
return AST8.isMethodOrProperty(node) && node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromError";
|
|
387
|
+
}
|
|
388
|
+
function isGetDerivedStateFromProps(node) {
|
|
389
|
+
return AST8.isMethodOrProperty(node) && node.static && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "getDerivedStateFromProps";
|
|
390
|
+
}
|
|
391
|
+
function isFunctionOfComponentDidMount(node) {
|
|
392
|
+
return AST8.isFunction(node) && isComponentDidMount(node.parent) && node.parent.value === node;
|
|
393
|
+
}
|
|
394
|
+
function isFunctionOfComponentWillUnmount(node) {
|
|
395
|
+
return AST8.isFunction(node) && isComponentWillUnmount(node.parent) && node.parent.value === node;
|
|
396
|
+
}
|
|
408
397
|
function isRenderMethodLike(node) {
|
|
409
|
-
return (node
|
|
398
|
+
return AST8.isMethodOrProperty(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "render" && node.parent.parent.type === AST_NODE_TYPES.ClassDeclaration;
|
|
410
399
|
}
|
|
411
400
|
function isFunctionOfRenderMethod(node) {
|
|
412
401
|
if (!isRenderMethodLike(node.parent)) {
|
|
@@ -417,8 +406,14 @@ function isFunctionOfRenderMethod(node) {
|
|
|
417
406
|
function isInsideRenderMethod(node) {
|
|
418
407
|
return AST8.findParentNode(node, (node2) => isRenderMethodLike(node2) && isClassComponent(node2.parent.parent)) != null;
|
|
419
408
|
}
|
|
420
|
-
|
|
421
|
-
|
|
409
|
+
var RE_COMPONENT_NAME = /^_?[A-Z]/u;
|
|
410
|
+
function getComponentNameFromIdentifier(node) {
|
|
411
|
+
if (node == null) return _;
|
|
412
|
+
return Array.isArray(node) ? node.map((n) => n.name).join(".") : node.name;
|
|
413
|
+
}
|
|
414
|
+
function isComponentName(name) {
|
|
415
|
+
return RE_COMPONENT_NAME.test(name);
|
|
416
|
+
}
|
|
422
417
|
function hasNoneOrValidComponentName(node, context) {
|
|
423
418
|
const id2 = getFunctionComponentIdentifier(node, context);
|
|
424
419
|
if (id2 == null) return true;
|
|
@@ -457,15 +452,17 @@ function hasValidHierarchy(node, context, hint) {
|
|
|
457
452
|
}
|
|
458
453
|
function getComponentFlag(initPath) {
|
|
459
454
|
let flag = ERFunctionComponentFlag.None;
|
|
460
|
-
if (initPath != null && AST8.hasCallInFunctionInitPath("memo"
|
|
455
|
+
if (initPath != null && AST8.hasCallInFunctionInitPath("memo", initPath)) {
|
|
461
456
|
flag |= ERFunctionComponentFlag.Memo;
|
|
462
457
|
}
|
|
463
|
-
if (initPath != null && AST8.hasCallInFunctionInitPath("forwardRef"
|
|
458
|
+
if (initPath != null && AST8.hasCallInFunctionInitPath("forwardRef", initPath)) {
|
|
464
459
|
flag |= ERFunctionComponentFlag.ForwardRef;
|
|
465
460
|
}
|
|
466
461
|
return flag;
|
|
467
462
|
}
|
|
468
|
-
|
|
463
|
+
var displayNameAssignmentSelector = "AssignmentExpression[type][operator='='][left.type='MemberExpression'][left.property.name='displayName']";
|
|
464
|
+
function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT, options = {}) {
|
|
465
|
+
const { collectDisplayName = false, collectHookCalls = false } = options;
|
|
469
466
|
const jsxCtx = { getScope: (node) => context.sourceCode.getScope(node) };
|
|
470
467
|
const components = /* @__PURE__ */ new Map();
|
|
471
468
|
const functionEntries = [];
|
|
@@ -481,7 +478,7 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
481
478
|
return functionEntries.pop();
|
|
482
479
|
}
|
|
483
480
|
const shouldDrop = AST8.getNestedReturnStatements(entry.node.body).slice().reverse().some((r) => {
|
|
484
|
-
return context.sourceCode.getScope(r).block === entry.node && r.argument != null && !
|
|
481
|
+
return context.sourceCode.getScope(r).block === entry.node && r.argument != null && !JSX3.isJSXValue(r.argument, jsxCtx, hint);
|
|
485
482
|
});
|
|
486
483
|
if (shouldDrop) {
|
|
487
484
|
components.delete(entry.key);
|
|
@@ -507,7 +504,7 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
507
504
|
return;
|
|
508
505
|
}
|
|
509
506
|
const { body } = entry.node;
|
|
510
|
-
const isComponent = hasNoneOrValidComponentName(entry.node, context) &&
|
|
507
|
+
const isComponent = hasNoneOrValidComponentName(entry.node, context) && JSX3.isJSXValue(body, jsxCtx, hint) && hasValidHierarchy(entry.node, context, hint);
|
|
511
508
|
if (!isComponent) {
|
|
512
509
|
return;
|
|
513
510
|
}
|
|
@@ -516,8 +513,8 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
516
513
|
const name = getComponentNameFromIdentifier(id2);
|
|
517
514
|
const key = getId();
|
|
518
515
|
components.set(key, {
|
|
519
|
-
_: key,
|
|
520
516
|
id: id2,
|
|
517
|
+
key,
|
|
521
518
|
kind: "function",
|
|
522
519
|
name,
|
|
523
520
|
node: entry.node,
|
|
@@ -528,35 +525,35 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
528
525
|
initPath
|
|
529
526
|
});
|
|
530
527
|
},
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
528
|
+
...collectDisplayName ? {
|
|
529
|
+
[displayNameAssignmentSelector](node) {
|
|
530
|
+
const { left, right } = node;
|
|
531
|
+
const componentName = left.object.type === AST_NODE_TYPES.Identifier ? left.object.name : _;
|
|
532
|
+
const component = [...components.values()].findLast(({ name }) => name != null && name === componentName);
|
|
533
|
+
if (component == null) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
component.displayName = right;
|
|
537
537
|
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
538
|
+
} : {},
|
|
539
|
+
...collectHookCalls ? {
|
|
540
|
+
"CallExpression[type]:exit"(node) {
|
|
541
|
+
if (!isReactHookCall(node)) {
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
const entry = getCurrentEntry();
|
|
545
|
+
if (entry == null) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
entry.hookCalls.push(node);
|
|
546
549
|
}
|
|
547
|
-
|
|
548
|
-
if (entry == null) {
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
functionEntries.pop();
|
|
552
|
-
functionEntries.push({ ...entry, hookCalls: [...entry.hookCalls, node] });
|
|
553
|
-
},
|
|
550
|
+
} : {},
|
|
554
551
|
"ReturnStatement[type]"(node) {
|
|
555
552
|
const entry = getCurrentEntry();
|
|
556
553
|
if (entry == null) {
|
|
557
554
|
return;
|
|
558
555
|
}
|
|
559
|
-
const isComponent = hasNoneOrValidComponentName(entry.node, context) &&
|
|
556
|
+
const isComponent = hasNoneOrValidComponentName(entry.node, context) && JSX3.isJSXValue(node.argument, jsxCtx, hint) && hasValidHierarchy(entry.node, context, hint);
|
|
560
557
|
if (!isComponent) {
|
|
561
558
|
return;
|
|
562
559
|
}
|
|
@@ -566,8 +563,8 @@ function useComponentCollector(context, hint = DEFAULT_COMPONENT_HINT) {
|
|
|
566
563
|
const id2 = getFunctionComponentIdentifier(entry.node, context);
|
|
567
564
|
const name = getComponentNameFromIdentifier(id2);
|
|
568
565
|
components.set(entry.key, {
|
|
569
|
-
_: entry.key,
|
|
570
566
|
id: id2,
|
|
567
|
+
key: entry.key,
|
|
571
568
|
kind: "function",
|
|
572
569
|
name,
|
|
573
570
|
node: entry.node,
|
|
@@ -599,8 +596,8 @@ function useComponentCollectorLegacy() {
|
|
|
599
596
|
components.set(
|
|
600
597
|
key,
|
|
601
598
|
{
|
|
602
|
-
_: key,
|
|
603
599
|
id: id2,
|
|
600
|
+
key,
|
|
604
601
|
kind: "class",
|
|
605
602
|
name: id2?.name,
|
|
606
603
|
node,
|
|
@@ -619,60 +616,22 @@ function useComponentCollectorLegacy() {
|
|
|
619
616
|
};
|
|
620
617
|
return { ctx, listeners };
|
|
621
618
|
}
|
|
622
|
-
function isSetupFunction(node) {
|
|
623
|
-
if (node == null) return _;
|
|
624
|
-
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);
|
|
625
|
-
}
|
|
626
|
-
function isCleanupFunction(node) {
|
|
627
|
-
const nearReturn = AST8.findParentNodeGuard(node, AST8.is(AST_NODE_TYPES.ReturnStatement));
|
|
628
|
-
const nearFunction = AST8.findParentNodeGuard(node, AST8.isFunction);
|
|
629
|
-
const nearFunctionOfReturn = AST8.findParentNodeGuard(nearReturn, AST8.isFunction);
|
|
630
|
-
return nearFunction === nearFunctionOfReturn && isSetupFunction(nearFunction);
|
|
631
|
-
}
|
|
632
|
-
function isComponentDidMount(node) {
|
|
633
|
-
return AST8.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentDidMount";
|
|
634
|
-
}
|
|
635
|
-
function isComponentWillUnmount(node) {
|
|
636
|
-
return AST8.isOneOf([AST_NODE_TYPES.MethodDefinition, AST_NODE_TYPES.PropertyDefinition])(node) && node.key.type === AST_NODE_TYPES.Identifier && node.key.name === "componentWillUnmount";
|
|
637
|
-
}
|
|
638
|
-
function isComponentDidMountFunction(node) {
|
|
639
|
-
return AST8.isFunction(node) && isComponentDidMount(node.parent) && node.parent.value === node;
|
|
640
|
-
}
|
|
641
|
-
function isComponentWillUnmountFunction(node) {
|
|
642
|
-
return AST8.isFunction(node) && isComponentWillUnmount(node.parent) && node.parent.value === node;
|
|
643
|
-
}
|
|
644
619
|
var ERPhaseRelevance = birecord({
|
|
645
620
|
mount: "unmount",
|
|
646
621
|
setup: "cleanup"
|
|
647
622
|
});
|
|
648
623
|
var isInversePhase = dual(2, (a, b) => ERPhaseRelevance.get(a) === b);
|
|
649
|
-
function isDirectValueOfRenderPropertyLoose(node) {
|
|
650
|
-
const matching = (node2) => {
|
|
651
|
-
return node2.type === AST_NODE_TYPES.Property && node2.key.type === AST_NODE_TYPES.Identifier && node2.key.name.startsWith("render");
|
|
652
|
-
};
|
|
653
|
-
return matching(node) || node.parent != null && matching(node.parent);
|
|
654
|
-
}
|
|
655
|
-
function isDeclaredInRenderPropLoose(node) {
|
|
656
|
-
if (isDirectValueOfRenderPropertyLoose(node)) {
|
|
657
|
-
return true;
|
|
658
|
-
}
|
|
659
|
-
const parent = AST8.findParentNodeGuard(node, AST8.is(AST_NODE_TYPES.JSXExpressionContainer))?.parent;
|
|
660
|
-
if (parent?.type !== AST_NODE_TYPES.JSXAttribute) {
|
|
661
|
-
return false;
|
|
662
|
-
}
|
|
663
|
-
return parent.name.type === AST_NODE_TYPES.JSXIdentifier && parent.name.name.startsWith("render");
|
|
664
|
-
}
|
|
665
624
|
function isRenderFunctionLoose(node, context) {
|
|
666
625
|
const { body, parent } = node;
|
|
667
626
|
if (AST8.getFunctionIdentifier(node)?.name.startsWith("render")) {
|
|
668
627
|
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");
|
|
669
628
|
}
|
|
670
|
-
return
|
|
629
|
+
return JSX3.isJSXValue(
|
|
671
630
|
body,
|
|
672
631
|
{
|
|
673
632
|
getScope: (node2) => context.sourceCode.getScope(node2)
|
|
674
633
|
},
|
|
675
|
-
|
|
634
|
+
JSX3.JSXValueHint.SkipNullLiteral | JSX3.JSXValueHint.SkipUndefined | JSX3.JSXValueHint.StrictLogical | JSX3.JSXValueHint.StrictConditional
|
|
676
635
|
);
|
|
677
636
|
}
|
|
678
637
|
function isRenderPropLoose(node, context) {
|
|
@@ -681,9 +640,35 @@ function isRenderPropLoose(node, context) {
|
|
|
681
640
|
}
|
|
682
641
|
return node.name.name.startsWith("render") && node.value?.type === AST_NODE_TYPES.JSXExpressionContainer && AST8.isFunction(node.value.expression) && isRenderFunctionLoose(node.value.expression, context);
|
|
683
642
|
}
|
|
643
|
+
function isDirectValueOfRenderPropertyLoose(node) {
|
|
644
|
+
const matching = (node2) => {
|
|
645
|
+
return node2.type === AST_NODE_TYPES.Property && node2.key.type === AST_NODE_TYPES.Identifier && node2.key.name.startsWith("render");
|
|
646
|
+
};
|
|
647
|
+
return matching(node) || node.parent != null && matching(node.parent);
|
|
648
|
+
}
|
|
649
|
+
function isDeclaredInRenderPropLoose(node) {
|
|
650
|
+
if (isDirectValueOfRenderPropertyLoose(node)) {
|
|
651
|
+
return true;
|
|
652
|
+
}
|
|
653
|
+
const parent = AST8.findParentNode(node, AST8.is(AST_NODE_TYPES.JSXExpressionContainer))?.parent;
|
|
654
|
+
if (parent?.type !== AST_NODE_TYPES.JSXAttribute) {
|
|
655
|
+
return false;
|
|
656
|
+
}
|
|
657
|
+
return parent.name.type === AST_NODE_TYPES.JSXIdentifier && parent.name.name.startsWith("render");
|
|
658
|
+
}
|
|
684
659
|
function isThisSetState(node) {
|
|
685
660
|
const { callee } = node;
|
|
686
661
|
return callee.type === AST_NODE_TYPES.MemberExpression && AST8.isThisExpression(callee.object) && callee.property.type === AST_NODE_TYPES.Identifier && callee.property.name === "setState";
|
|
687
662
|
}
|
|
663
|
+
function isFunctionOfUseEffectSetup(node) {
|
|
664
|
+
if (node == null) return _;
|
|
665
|
+
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);
|
|
666
|
+
}
|
|
667
|
+
function isFunctionOfUseEffectCleanup(node) {
|
|
668
|
+
const nearReturn = AST8.findParentNode(node, AST8.is(AST_NODE_TYPES.ReturnStatement));
|
|
669
|
+
const nearFunction = AST8.findParentNode(node, AST8.isFunction);
|
|
670
|
+
const nearFunctionOfReturn = AST8.findParentNode(nearReturn, AST8.isFunction);
|
|
671
|
+
return nearFunction === nearFunctionOfReturn && isFunctionOfUseEffectSetup(nearFunction);
|
|
672
|
+
}
|
|
688
673
|
|
|
689
|
-
export { DEFAULT_COMPONENT_HINT, ERClassComponentFlag, ERComponentHint, ERFunctionComponentFlag, ERPhaseRelevance, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier,
|
|
674
|
+
export { DEFAULT_COMPONENT_HINT, ERClassComponentFlag, ERComponentHint, ERFunctionComponentFlag, ERPhaseRelevance, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getFunctionComponentIdentifier, getId, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentName, isComponentWillUnmount, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfComponentDidMount, isFunctionOfComponentWillUnmount, isFunctionOfRenderMethod, isFunctionOfUseEffectCleanup, isFunctionOfUseEffectSetup, isGetDerivedStateFromError, isGetDerivedStateFromProps, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderMethodLike, isRenderPropLoose, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "1.24.0-next.
|
|
3
|
+
"version": "1.24.0-next.12",
|
|
4
4
|
"description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"./package.json"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
37
|
-
"@typescript-eslint/type-utils": "^8.
|
|
38
|
-
"@typescript-eslint/types": "^8.
|
|
39
|
-
"@typescript-eslint/utils": "^8.
|
|
36
|
+
"@typescript-eslint/scope-manager": "^8.20.0",
|
|
37
|
+
"@typescript-eslint/type-utils": "^8.20.0",
|
|
38
|
+
"@typescript-eslint/types": "^8.20.0",
|
|
39
|
+
"@typescript-eslint/utils": "^8.20.0",
|
|
40
|
+
"birecord": "^0.1.1",
|
|
40
41
|
"ts-pattern": "^5.6.0",
|
|
41
|
-
"@eslint-react/ast": "1.24.0-next.
|
|
42
|
-
"@eslint-react/
|
|
43
|
-
"@eslint-react/
|
|
44
|
-
"@eslint-react/shared": "1.24.0-next.
|
|
45
|
-
"@eslint-react/var": "1.24.0-next.
|
|
46
|
-
"@eslint-react/types": "1.24.0-next.1"
|
|
42
|
+
"@eslint-react/ast": "1.24.0-next.12",
|
|
43
|
+
"@eslint-react/eff": "1.24.0-next.12",
|
|
44
|
+
"@eslint-react/jsx": "1.24.0-next.12",
|
|
45
|
+
"@eslint-react/shared": "1.24.0-next.12",
|
|
46
|
+
"@eslint-react/var": "1.24.0-next.12"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"tsup": "^8.3.5",
|