@eslint-react/core 2.7.5-beta.0 → 2.7.5-beta.3
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.ts +19 -7
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -250,7 +250,7 @@ interface ClassComponent extends SemanticNode {
|
|
|
250
250
|
/**
|
|
251
251
|
* Union type representing either a class or function component
|
|
252
252
|
*/
|
|
253
|
-
type
|
|
253
|
+
type ReactComponent = ClassComponent | FunctionComponent;
|
|
254
254
|
//#endregion
|
|
255
255
|
//#region src/component/component-collector.d.ts
|
|
256
256
|
type FunctionEntry$1 = {
|
|
@@ -503,6 +503,18 @@ declare function isComponentWrapperCallback(context: RuleContext, node: TSESTree
|
|
|
503
503
|
*/
|
|
504
504
|
declare function isComponentWrapperCallbackLoose(context: RuleContext, node: TSESTree.Node): boolean;
|
|
505
505
|
//#endregion
|
|
506
|
+
//#region src/function/function-semantic-node.d.ts
|
|
507
|
+
interface ReactFunction extends SemanticNode {
|
|
508
|
+
id: AST.FunctionID | unit;
|
|
509
|
+
node: AST.TSESTreeFunction;
|
|
510
|
+
name: string | unit;
|
|
511
|
+
type: TSESTree.TSTypeAnnotation | unit;
|
|
512
|
+
body: TSESTree.BlockStatement | TSESTree.Expression;
|
|
513
|
+
directives: TSESTree.StringLiteral[];
|
|
514
|
+
parameters: TSESTree.Parameter[];
|
|
515
|
+
typeParameters: TSESTree.TSTypeParameterDeclaration | unit;
|
|
516
|
+
}
|
|
517
|
+
//#endregion
|
|
506
518
|
//#region src/hierarchy/find-enclosing-component-or-hook.d.ts
|
|
507
519
|
type FindEnclosingComponentOrHookFilter = (n: TSESTree.Node, name: string | null) => boolean;
|
|
508
520
|
/**
|
|
@@ -511,7 +523,7 @@ type FindEnclosingComponentOrHookFilter = (n: TSESTree.Node, name: string | null
|
|
|
511
523
|
* @param test Optional test function to customize component or hook identification
|
|
512
524
|
* @returns The enclosing component or hook node, or `null` if none is found
|
|
513
525
|
*/
|
|
514
|
-
declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.
|
|
526
|
+
declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | undefined;
|
|
515
527
|
//#endregion
|
|
516
528
|
//#region src/hierarchy/is-inside-component-or-hook.d.ts
|
|
517
529
|
/**
|
|
@@ -534,7 +546,7 @@ declare function isUseEffectSetupCallback(node: TSESTree.Node | unit): boolean;
|
|
|
534
546
|
declare function isUseEffectCleanupCallback(node: TSESTree.Node | unit): boolean;
|
|
535
547
|
//#endregion
|
|
536
548
|
//#region src/hook/hook-semantic-node.d.ts
|
|
537
|
-
interface
|
|
549
|
+
interface ReactHook extends SemanticNode {
|
|
538
550
|
id: AST.FunctionID | unit;
|
|
539
551
|
node: AST.TSESTreeFunction;
|
|
540
552
|
name: string;
|
|
@@ -550,7 +562,7 @@ type FunctionEntry = {
|
|
|
550
562
|
declare namespace useHookCollector {
|
|
551
563
|
type ReturnType = {
|
|
552
564
|
ctx: {
|
|
553
|
-
getAllHooks(node: TSESTree$1.Program):
|
|
565
|
+
getAllHooks(node: TSESTree$1.Program): ReactHook[];
|
|
554
566
|
getCurrentEntries(): FunctionEntry[];
|
|
555
567
|
getCurrentEntry(): FunctionEntry | unit;
|
|
556
568
|
};
|
|
@@ -695,7 +707,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
695
707
|
readonly toStatic: () => string | number | bigint | boolean | RegExp | null;
|
|
696
708
|
} | {
|
|
697
709
|
readonly kind: "expression";
|
|
698
|
-
readonly node: TSESTree.
|
|
710
|
+
readonly node: TSESTree.JSXEmptyExpression | TSESTree.Expression;
|
|
699
711
|
readonly toStatic: () => unknown;
|
|
700
712
|
} | {
|
|
701
713
|
readonly kind: "element";
|
|
@@ -703,7 +715,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
703
715
|
readonly toStatic: () => undefined;
|
|
704
716
|
} | {
|
|
705
717
|
readonly kind: "spreadChild";
|
|
706
|
-
readonly node: TSESTree.
|
|
718
|
+
readonly node: TSESTree.JSXEmptyExpression | TSESTree.Expression;
|
|
707
719
|
readonly toStatic: () => undefined;
|
|
708
720
|
} | {
|
|
709
721
|
readonly kind: "spreadProps";
|
|
@@ -859,4 +871,4 @@ declare function isInitializedFromRef(name: string, initialScope: Scope): boolea
|
|
|
859
871
|
*/
|
|
860
872
|
declare function isRefName(name: string): boolean;
|
|
861
873
|
//#endregion
|
|
862
|
-
export { ClassComponent,
|
|
874
|
+
export { ClassComponent, ComponentDetectionHint, ComponentEffectPhaseKind, ComponentFlag, ComponentKind, ComponentLifecyclePhaseKind, ComponentPhaseKind, ComponentPhaseRelevance, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, FindEnclosingComponentOrHookFilter, FunctionComponent, JsxAttributeValue, JsxConfig, JsxDetectionHint, JsxEmit, REACT_BUILTIN_HOOK_NAMES, ReactComponent, ReactFunction, ReactHook, SemanticEntry, SemanticNode, findEnclosingComponentOrHook, findParentJsxAttribute, getComponentFlagFromInitPath, getFunctionComponentId, getJsxAttribute, getJsxAttributeName, getJsxConfigFromAnnotation, getJsxConfigFromContext, getJsxElementType, getPhaseKindOfFunction, hasNoneOrLooseComponentName, isAssignmentToThisState, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDefinition, isComponentDidCatch, isComponentDidMount, isComponentDidMountCallback, isComponentDidUpdate, isComponentName, isComponentNameLoose, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUnmountCallback, isComponentWillUpdate, isComponentWrapperCall, isComponentWrapperCallLoose, isComponentWrapperCallback, isComponentWrapperCallbackLoose, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isInitializedFromReact, isInitializedFromReactNative, isInitializedFromRef, isInsideComponentOrHook, isInversePhase, isJsxFragmentElement, isJsxHostElement, isJsxLike, isJsxText, isLazy, isLazyCall, isMemo, isMemoCall, isPureComponent, isReactAPI, isReactAPICall, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookId, isReactHookName, isRefName, isRender, isRenderFunctionLoose, isRenderMethodLike, isRenderPropLoose, isShouldComponentUpdate, isThisSetState, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUseActionStateCall, isUseCall, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCleanupCallback, isUseEffectLikeCall, isUseEffectSetupCallback, isUseFormStatusCall, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseOptimisticCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseStateLikeCall, isUseSyncExternalStoreCall, isUseTransitionCall, resolveJsxAttributeValue, stringifyJsx, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "2.7.5-beta.
|
|
3
|
+
"version": "2.7.5-beta.3",
|
|
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": {
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"./package.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@typescript-eslint/scope-manager": "^8.
|
|
34
|
-
"@typescript-eslint/types": "^8.
|
|
35
|
-
"@typescript-eslint/utils": "^8.
|
|
33
|
+
"@typescript-eslint/scope-manager": "^8.54.0",
|
|
34
|
+
"@typescript-eslint/types": "^8.54.0",
|
|
35
|
+
"@typescript-eslint/utils": "^8.54.0",
|
|
36
36
|
"birecord": "^0.1.1",
|
|
37
37
|
"ts-pattern": "^5.9.0",
|
|
38
|
-
"@eslint-react/
|
|
39
|
-
"@eslint-react/
|
|
40
|
-
"@eslint-react/
|
|
41
|
-
"@eslint-react/
|
|
38
|
+
"@eslint-react/eff": "2.7.5-beta.3",
|
|
39
|
+
"@eslint-react/ast": "2.7.5-beta.3",
|
|
40
|
+
"@eslint-react/shared": "2.7.5-beta.3",
|
|
41
|
+
"@eslint-react/var": "2.7.5-beta.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"tsdown": "^0.20.1",
|