@eslint-react/core 2.7.5-beta.4 → 2.7.5-beta.5

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +27 -9
  2. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -165,7 +165,7 @@ declare const ComponentFlag: {
165
165
  /**
166
166
  * Represents a React function component
167
167
  */
168
- interface FunctionComponent extends SemanticNode {
168
+ interface FunctionComponentSemanticNode extends SemanticNode {
169
169
  /**
170
170
  * The identifier or identifier sequence of the component
171
171
  */
@@ -214,7 +214,7 @@ interface FunctionComponent extends SemanticNode {
214
214
  /**
215
215
  * Represents a React class component
216
216
  */
217
- interface ClassComponent extends SemanticNode {
217
+ interface ClassComponentSemanticNode extends SemanticNode {
218
218
  /**
219
219
  * The identifier of the component
220
220
  */
@@ -247,7 +247,7 @@ interface ClassComponent extends SemanticNode {
247
247
  /**
248
248
  * Union type representing either a class or function component
249
249
  */
250
- type Component = ClassComponent | FunctionComponent;
250
+ type ComponentSemanticNode = ClassComponentSemanticNode | FunctionComponentSemanticNode;
251
251
  //#endregion
252
252
  //#region src/component/component-collector.d.ts
253
253
  type FunctionEntry$1 = {
@@ -268,7 +268,7 @@ declare namespace useComponentCollector {
268
268
  };
269
269
  type ReturnType = {
270
270
  ctx: {
271
- getAllComponents: (node: TSESTree.Program) => FunctionComponent[];
271
+ getAllComponents: (node: TSESTree.Program) => FunctionComponentSemanticNode[];
272
272
  getCurrentEntries: () => FunctionEntry$1[];
273
273
  getCurrentEntry: () => FunctionEntry$1 | unit;
274
274
  };
@@ -287,7 +287,7 @@ declare function useComponentCollector(context: RuleContext, options?: useCompon
287
287
  declare namespace useComponentCollectorLegacy {
288
288
  type ReturnType = {
289
289
  ctx: {
290
- getAllComponents: (node: TSESTree$1.Program) => ClassComponent[];
290
+ getAllComponents: (node: TSESTree$1.Program) => ClassComponentSemanticNode[];
291
291
  };
292
292
  visitor: ESLintUtils.RuleListener;
293
293
  };
@@ -326,7 +326,7 @@ declare function isComponentDefinition(context: RuleContext, node: AST.TSESTreeF
326
326
  declare function getFunctionComponentId(context: RuleContext, node: AST.TSESTreeFunction): AST.FunctionID | unit;
327
327
  //#endregion
328
328
  //#region src/component/component-init-path.d.ts
329
- declare function getComponentFlagFromInitPath(initPath: FunctionComponent["initPath"]): bigint;
329
+ declare function getComponentFlagFromInitPath(initPath: FunctionComponentSemanticNode["initPath"]): bigint;
330
330
  //#endregion
331
331
  //#region src/component/component-is.d.ts
332
332
  /**
@@ -509,6 +509,24 @@ declare function isComponentWrapperCallback(context: RuleContext, node: TSESTree
509
509
  */
510
510
  declare function isComponentWrapperCallbackLoose(context: RuleContext, node: TSESTree.Node): boolean;
511
511
  //#endregion
512
+ //#region src/function/function-semantic-node.d.ts
513
+ /**
514
+ * Represents a React function
515
+ */
516
+ interface ClientFunctionSemanticNode extends SemanticFunc {
517
+ /**
518
+ * The kind of function
519
+ */
520
+ kind: "client-function";
521
+ }
522
+ interface ServerFunctionSemanticNode extends SemanticFunc {
523
+ /**
524
+ * The kind of function
525
+ */
526
+ kind: "server-function";
527
+ }
528
+ type FunctionSemanticNode = ClientFunctionSemanticNode | ServerFunctionSemanticNode;
529
+ //#endregion
512
530
  //#region src/hierarchy/find-enclosing-component-or-hook.d.ts
513
531
  type FindEnclosingComponentOrHookFilter = (n: TSESTree.Node, name: string | null) => boolean;
514
532
  /**
@@ -540,7 +558,7 @@ declare function isUseEffectSetupCallback(node: TSESTree.Node | unit): boolean;
540
558
  declare function isUseEffectCleanupCallback(node: TSESTree.Node | unit): boolean;
541
559
  //#endregion
542
560
  //#region src/hook/hook-semantic-node.d.ts
543
- interface Hook extends SemanticNode {
561
+ interface HookSemanticNode extends SemanticNode {
544
562
  id: AST.FunctionID | unit;
545
563
  node: AST.TSESTreeFunction;
546
564
  name: string;
@@ -556,7 +574,7 @@ type FunctionEntry = {
556
574
  declare namespace useHookCollector {
557
575
  type ReturnType = {
558
576
  ctx: {
559
- getAllHooks(node: TSESTree$1.Program): Hook[];
577
+ getAllHooks(node: TSESTree$1.Program): HookSemanticNode[];
560
578
  getCurrentEntries(): FunctionEntry[];
561
579
  getCurrentEntry(): FunctionEntry | unit;
562
580
  };
@@ -865,4 +883,4 @@ declare function isInitializedFromRef(name: string, initialScope: Scope): boolea
865
883
  */
866
884
  declare function isRefName(name: string): boolean;
867
885
  //#endregion
868
- export { ClassComponent, Component, ComponentDetectionHint, ComponentEffectPhaseKind, ComponentFlag, ComponentKind, ComponentLifecyclePhaseKind, ComponentPhaseKind, ComponentPhaseRelevance, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, FindEnclosingComponentOrHookFilter, FunctionComponent, Hook, JsxAttributeValue, JsxConfig, JsxDetectionHint, JsxEmit, REACT_BUILTIN_HOOK_NAMES, SemanticFunc, 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, 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 };
886
+ 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/core",
3
- "version": "2.7.5-beta.4",
3
+ "version": "2.7.5-beta.5",
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/shared": "2.7.5-beta.4",
39
- "@eslint-react/ast": "2.7.5-beta.4",
40
- "@eslint-react/var": "2.7.5-beta.4",
41
- "@eslint-react/eff": "2.7.5-beta.4"
38
+ "@eslint-react/ast": "2.7.5-beta.5",
39
+ "@eslint-react/shared": "2.7.5-beta.5",
40
+ "@eslint-react/var": "2.7.5-beta.5",
41
+ "@eslint-react/eff": "2.7.5-beta.5"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsdown": "^0.20.1",