@eslint-react/core 2.7.5-next.4 → 2.7.5-next.6
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 +31 -14
- package/dist/index.js +1 -2
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -157,15 +157,14 @@ declare const ComponentFlag: {
|
|
|
157
157
|
PureComponent: bigint; /** Indicates the component creates elements using `createElement` instead of JSX */
|
|
158
158
|
CreateElement: bigint; /** Indicates the component is memoized (e.g., React.memo) */
|
|
159
159
|
Memo: bigint; /** Indicates the component forwards a ref (e.g., React.forwardRef) */
|
|
160
|
-
ForwardRef: bigint;
|
|
161
|
-
Async: bigint;
|
|
160
|
+
ForwardRef: bigint;
|
|
162
161
|
};
|
|
163
162
|
//#endregion
|
|
164
163
|
//#region src/component/component-semantic-node.d.ts
|
|
165
164
|
/**
|
|
166
165
|
* Represents a React function component
|
|
167
166
|
*/
|
|
168
|
-
interface
|
|
167
|
+
interface FunctionComponentSemanticNode extends SemanticNode {
|
|
169
168
|
/**
|
|
170
169
|
* The identifier or identifier sequence of the component
|
|
171
170
|
*/
|
|
@@ -214,7 +213,7 @@ interface FunctionComponent extends SemanticNode {
|
|
|
214
213
|
/**
|
|
215
214
|
* Represents a React class component
|
|
216
215
|
*/
|
|
217
|
-
interface
|
|
216
|
+
interface ClassComponentSemanticNode extends SemanticNode {
|
|
218
217
|
/**
|
|
219
218
|
* The identifier of the component
|
|
220
219
|
*/
|
|
@@ -247,7 +246,7 @@ interface ClassComponent extends SemanticNode {
|
|
|
247
246
|
/**
|
|
248
247
|
* Union type representing either a class or function component
|
|
249
248
|
*/
|
|
250
|
-
type
|
|
249
|
+
type ComponentSemanticNode = ClassComponentSemanticNode | FunctionComponentSemanticNode;
|
|
251
250
|
//#endregion
|
|
252
251
|
//#region src/component/component-collector.d.ts
|
|
253
252
|
type FunctionEntry$1 = {
|
|
@@ -268,7 +267,7 @@ declare namespace useComponentCollector {
|
|
|
268
267
|
};
|
|
269
268
|
type ReturnType = {
|
|
270
269
|
ctx: {
|
|
271
|
-
getAllComponents: (node: TSESTree.Program) =>
|
|
270
|
+
getAllComponents: (node: TSESTree.Program) => FunctionComponentSemanticNode[];
|
|
272
271
|
getCurrentEntries: () => FunctionEntry$1[];
|
|
273
272
|
getCurrentEntry: () => FunctionEntry$1 | unit;
|
|
274
273
|
};
|
|
@@ -287,7 +286,7 @@ declare function useComponentCollector(context: RuleContext, options?: useCompon
|
|
|
287
286
|
declare namespace useComponentCollectorLegacy {
|
|
288
287
|
type ReturnType = {
|
|
289
288
|
ctx: {
|
|
290
|
-
getAllComponents: (node: TSESTree$1.Program) =>
|
|
289
|
+
getAllComponents: (node: TSESTree$1.Program) => ClassComponentSemanticNode[];
|
|
291
290
|
};
|
|
292
291
|
visitor: ESLintUtils.RuleListener;
|
|
293
292
|
};
|
|
@@ -326,7 +325,7 @@ declare function isComponentDefinition(context: RuleContext, node: AST.TSESTreeF
|
|
|
326
325
|
declare function getFunctionComponentId(context: RuleContext, node: AST.TSESTreeFunction): AST.FunctionID | unit;
|
|
327
326
|
//#endregion
|
|
328
327
|
//#region src/component/component-init-path.d.ts
|
|
329
|
-
declare function getComponentFlagFromInitPath(initPath:
|
|
328
|
+
declare function getComponentFlagFromInitPath(initPath: FunctionComponentSemanticNode["initPath"]): bigint;
|
|
330
329
|
//#endregion
|
|
331
330
|
//#region src/component/component-is.d.ts
|
|
332
331
|
/**
|
|
@@ -509,6 +508,24 @@ declare function isComponentWrapperCallback(context: RuleContext, node: TSESTree
|
|
|
509
508
|
*/
|
|
510
509
|
declare function isComponentWrapperCallbackLoose(context: RuleContext, node: TSESTree.Node): boolean;
|
|
511
510
|
//#endregion
|
|
511
|
+
//#region src/function/function-semantic-node.d.ts
|
|
512
|
+
/**
|
|
513
|
+
* Represents a React function
|
|
514
|
+
*/
|
|
515
|
+
interface ClientFunctionSemanticNode extends SemanticFunc {
|
|
516
|
+
/**
|
|
517
|
+
* The kind of function
|
|
518
|
+
*/
|
|
519
|
+
kind: "client-function";
|
|
520
|
+
}
|
|
521
|
+
interface ServerFunctionSemanticNode extends SemanticFunc {
|
|
522
|
+
/**
|
|
523
|
+
* The kind of function
|
|
524
|
+
*/
|
|
525
|
+
kind: "server-function";
|
|
526
|
+
}
|
|
527
|
+
type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSemanticNode;
|
|
528
|
+
//#endregion
|
|
512
529
|
//#region src/hierarchy/find-enclosing-component-or-hook.d.ts
|
|
513
530
|
type FindEnclosingComponentOrHookFilter = (n: TSESTree.Node, name: string | null) => boolean;
|
|
514
531
|
/**
|
|
@@ -517,7 +534,7 @@ type FindEnclosingComponentOrHookFilter = (n: TSESTree.Node, name: string | null
|
|
|
517
534
|
* @param test Optional test function to customize component or hook identification
|
|
518
535
|
* @returns The enclosing component or hook node, or `null` if none is found
|
|
519
536
|
*/
|
|
520
|
-
declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.
|
|
537
|
+
declare function findEnclosingComponentOrHook(node: TSESTree.Node | unit, test?: FindEnclosingComponentOrHookFilter): TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | undefined;
|
|
521
538
|
//#endregion
|
|
522
539
|
//#region src/hierarchy/is-inside-component-or-hook.d.ts
|
|
523
540
|
/**
|
|
@@ -540,7 +557,7 @@ declare function isUseEffectSetupCallback(node: TSESTree.Node | unit): boolean;
|
|
|
540
557
|
declare function isUseEffectCleanupCallback(node: TSESTree.Node | unit): boolean;
|
|
541
558
|
//#endregion
|
|
542
559
|
//#region src/hook/hook-semantic-node.d.ts
|
|
543
|
-
interface
|
|
560
|
+
interface HookSemanticNode extends SemanticNode {
|
|
544
561
|
id: AST.FunctionID | unit;
|
|
545
562
|
node: AST.TSESTreeFunction;
|
|
546
563
|
name: string;
|
|
@@ -556,7 +573,7 @@ type FunctionEntry = {
|
|
|
556
573
|
declare namespace useHookCollector {
|
|
557
574
|
type ReturnType = {
|
|
558
575
|
ctx: {
|
|
559
|
-
getAllHooks(node: TSESTree$1.Program):
|
|
576
|
+
getAllHooks(node: TSESTree$1.Program): HookSemanticNode[];
|
|
560
577
|
getCurrentEntries(): FunctionEntry[];
|
|
561
578
|
getCurrentEntry(): FunctionEntry | unit;
|
|
562
579
|
};
|
|
@@ -701,7 +718,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
701
718
|
readonly toStatic: () => string | number | bigint | boolean | RegExp | null;
|
|
702
719
|
} | {
|
|
703
720
|
readonly kind: "expression";
|
|
704
|
-
readonly node: TSESTree.
|
|
721
|
+
readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
|
|
705
722
|
readonly toStatic: () => unknown;
|
|
706
723
|
} | {
|
|
707
724
|
readonly kind: "element";
|
|
@@ -709,7 +726,7 @@ declare function resolveJsxAttributeValue(context: RuleContext, attribute: AST.T
|
|
|
709
726
|
readonly toStatic: () => undefined;
|
|
710
727
|
} | {
|
|
711
728
|
readonly kind: "spreadChild";
|
|
712
|
-
readonly node: TSESTree.
|
|
729
|
+
readonly node: TSESTree.Expression | TSESTree.JSXEmptyExpression;
|
|
713
730
|
readonly toStatic: () => undefined;
|
|
714
731
|
} | {
|
|
715
732
|
readonly kind: "spreadProps";
|
|
@@ -865,4 +882,4 @@ declare function isInitializedFromRef(name: string, initialScope: Scope): boolea
|
|
|
865
882
|
*/
|
|
866
883
|
declare function isRefName(name: string): boolean;
|
|
867
884
|
//#endregion
|
|
868
|
-
export {
|
|
885
|
+
export { ClassComponentSemanticNode, ClientFunctionSemanticNode, ComponentDetectionHint, ComponentEffectPhaseKind, ComponentFlag, ComponentKind, ComponentLifecyclePhaseKind, ComponentPhaseKind, ComponentPhaseRelevance, ComponentSemanticNode, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, FindEnclosingComponentOrHookFilter, FunctionComponentSemanticNode, FunctionSemanticNode, HookSemanticNode, JsxAttributeValue, JsxConfig, JsxDetectionHint, JsxEmit, REACT_BUILTIN_HOOK_NAMES, SemanticFunc, SemanticNode, ServerFunctionSemanticNode, 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, isHook, isHookCall, isHookCallWithName, isHookId, isHookName, isInitializedFromReact, isInitializedFromReactNative, isInitializedFromRef, isInsideComponentOrHook, isInversePhase, isJsxFragmentElement, isJsxHostElement, isJsxLike, isJsxText, isLazy, isLazyCall, isMemo, isMemoCall, isPureComponent, isReactAPI, isReactAPICall, 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/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "2.7.5-next.
|
|
3
|
+
"version": "2.7.5-next.6",
|
|
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": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@typescript-eslint/utils": "^8.54.0",
|
|
36
36
|
"birecord": "^0.1.1",
|
|
37
37
|
"ts-pattern": "^5.9.0",
|
|
38
|
-
"@eslint-react/ast": "2.7.5-next.
|
|
39
|
-
"@eslint-react/eff": "2.7.5-next.
|
|
40
|
-
"@eslint-react/
|
|
41
|
-
"@eslint-react/
|
|
38
|
+
"@eslint-react/ast": "2.7.5-next.6",
|
|
39
|
+
"@eslint-react/eff": "2.7.5-next.6",
|
|
40
|
+
"@eslint-react/var": "2.7.5-next.6",
|
|
41
|
+
"@eslint-react/shared": "2.7.5-next.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"tsdown": "^0.20.1",
|