@eslint-react/core 1.23.2-next.6 → 1.23.3-beta.2

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 CHANGED
@@ -30,13 +30,14 @@ declare const ERComponentHint: {
30
30
  readonly SkipClassMethod: bigint;
31
31
  readonly SkipClassProperty: bigint;
32
32
  readonly None: 0n;
33
+ readonly SkipUndefined: bigint;
33
34
  readonly SkipNullLiteral: bigint;
34
- readonly SkipUndefinedLiteral: bigint;
35
35
  readonly SkipBooleanLiteral: bigint;
36
36
  readonly SkipStringLiteral: bigint;
37
37
  readonly SkipNumberLiteral: bigint;
38
- readonly SkipCreateElement: bigint;
38
+ readonly SkipBigIntLiteral: bigint;
39
39
  readonly SkipEmptyArray: bigint;
40
+ readonly SkipCreateElement: bigint;
40
41
  readonly StrictArray: bigint;
41
42
  readonly StrictLogical: bigint;
42
43
  readonly StrictConditional: bigint;
@@ -109,22 +110,6 @@ declare function useComponentCollector(context: RuleContext, hint?: bigint): {
109
110
  };
110
111
  };
111
112
 
112
- /**
113
- * Check if a node is a React class component
114
- * @param node The AST node to check
115
- * @returns `true` if the node is a class component, `false` otherwise
116
- */
117
- declare function isClassComponent(node: TSESTree$1.Node): node is AST.TSESTreeClass;
118
- /**
119
- * Check if a node is a React PureComponent
120
- * @param node The AST node to check
121
- * @returns `true` if the node is a pure component, `false` otherwise
122
- */
123
- declare function isPureComponent(node: TSESTree$1.Node): boolean;
124
- declare function isComponentDidMount(node: TSESTree$1.Node): node is TSESTree$1.MethodDefinition | TSESTree$1.PropertyDefinition;
125
- declare function isComponentWillUnmount(node: TSESTree$1.Node): node is TSESTree$1.MethodDefinition | TSESTree$1.PropertyDefinition;
126
- declare function isComponentDidMountFunction(node: TSESTree$1.Node): boolean;
127
- declare function isComponentWillUnmountFunction(node: TSESTree$1.Node): boolean;
128
113
  declare function useComponentCollectorLegacy(): {
129
114
  readonly ctx: {
130
115
  readonly getAllComponents: (_: TSESTree$1.Program) => Map<string, ERClassComponent>;
@@ -146,6 +131,7 @@ declare const RE_COMPONENT_NAME: RegExp;
146
131
  declare function getComponentNameFromIdentifier(node: TSESTree.Identifier | TSESTree.Identifier[]): string;
147
132
  declare function isComponentName(name: string): boolean;
148
133
 
134
+ declare function isRenderMethodLike(node: TSESTree$1.Node): node is TSESTree$1.MethodDefinition | TSESTree$1.PropertyDefinition;
149
135
  declare function isFunctionOfRenderMethod(node: AST.TSESTreeFunction): boolean;
150
136
  /**
151
137
  * Check whether given node is declared inside class component's render block
@@ -164,6 +150,19 @@ declare function isFunctionOfRenderMethod(node: AST.TSESTreeFunction): boolean;
164
150
  */
165
151
  declare function isInsideRenderMethod(node: TSESTree$1.Node): boolean;
166
152
 
153
+ /**
154
+ * Check if a node is a React class component
155
+ * @param node The AST node to check
156
+ * @returns `true` if the node is a class component, `false` otherwise
157
+ */
158
+ declare function isClassComponent(node: TSESTree.Node): node is AST.TSESTreeClass;
159
+ /**
160
+ * Check if a node is a React PureComponent
161
+ * @param node The AST node to check
162
+ * @returns `true` if the node is a pure component, `false` otherwise
163
+ */
164
+ declare function isPureComponent(node: TSESTree.Node): boolean;
165
+
167
166
  declare function hasNoneOrValidComponentName(node: AST.TSESTreeFunction, context: RuleContext): boolean;
168
167
 
169
168
  type EREffectKind = "effect" | "insertionEffect" | "layoutEffect";
@@ -241,6 +240,11 @@ declare const isUseStateCall: (node: TSESTree.CallExpression, context: Readonly<
241
240
  declare const isUseSyncExternalStoreCall: (node: TSESTree.CallExpression, context: Readonly<_typescript_eslint_utils_ts_eslint.RuleContext<string, readonly unknown[]>>) => boolean;
242
241
  declare const isUseTransitionCall: (node: TSESTree.CallExpression, context: Readonly<_typescript_eslint_utils_ts_eslint.RuleContext<string, readonly unknown[]>>) => boolean;
243
242
 
243
+ declare function isComponentDidMount(node: TSESTree.Node): node is TSESTree.MethodDefinition | TSESTree.PropertyDefinition;
244
+ declare function isComponentWillUnmount(node: TSESTree.Node): node is TSESTree.MethodDefinition | TSESTree.PropertyDefinition;
245
+ declare function isComponentDidMountFunction(node: TSESTree.Node): boolean;
246
+ declare function isComponentWillUnmountFunction(node: TSESTree.Node): boolean;
247
+
244
248
  declare const ERPhaseRelevance: _eslint_react_types.BiRecord<{
245
249
  readonly mount: "unmount";
246
250
  readonly setup: "cleanup";
@@ -2569,4 +2573,4 @@ declare const isMemoCall: {
2569
2573
  (node: Node, context: _eslint_react_types.RuleContext): node is CallExpression;
2570
2574
  };
2571
2575
 
2572
- export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, getId, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfRenderMethod, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderPropLoose, isSetupFunction, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
2576
+ export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, getId, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfRenderMethod, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderMethodLike, isRenderPropLoose, isSetupFunction, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
package/dist/index.d.ts CHANGED
@@ -30,13 +30,14 @@ declare const ERComponentHint: {
30
30
  readonly SkipClassMethod: bigint;
31
31
  readonly SkipClassProperty: bigint;
32
32
  readonly None: 0n;
33
+ readonly SkipUndefined: bigint;
33
34
  readonly SkipNullLiteral: bigint;
34
- readonly SkipUndefinedLiteral: bigint;
35
35
  readonly SkipBooleanLiteral: bigint;
36
36
  readonly SkipStringLiteral: bigint;
37
37
  readonly SkipNumberLiteral: bigint;
38
- readonly SkipCreateElement: bigint;
38
+ readonly SkipBigIntLiteral: bigint;
39
39
  readonly SkipEmptyArray: bigint;
40
+ readonly SkipCreateElement: bigint;
40
41
  readonly StrictArray: bigint;
41
42
  readonly StrictLogical: bigint;
42
43
  readonly StrictConditional: bigint;
@@ -109,22 +110,6 @@ declare function useComponentCollector(context: RuleContext, hint?: bigint): {
109
110
  };
110
111
  };
111
112
 
112
- /**
113
- * Check if a node is a React class component
114
- * @param node The AST node to check
115
- * @returns `true` if the node is a class component, `false` otherwise
116
- */
117
- declare function isClassComponent(node: TSESTree$1.Node): node is AST.TSESTreeClass;
118
- /**
119
- * Check if a node is a React PureComponent
120
- * @param node The AST node to check
121
- * @returns `true` if the node is a pure component, `false` otherwise
122
- */
123
- declare function isPureComponent(node: TSESTree$1.Node): boolean;
124
- declare function isComponentDidMount(node: TSESTree$1.Node): node is TSESTree$1.MethodDefinition | TSESTree$1.PropertyDefinition;
125
- declare function isComponentWillUnmount(node: TSESTree$1.Node): node is TSESTree$1.MethodDefinition | TSESTree$1.PropertyDefinition;
126
- declare function isComponentDidMountFunction(node: TSESTree$1.Node): boolean;
127
- declare function isComponentWillUnmountFunction(node: TSESTree$1.Node): boolean;
128
113
  declare function useComponentCollectorLegacy(): {
129
114
  readonly ctx: {
130
115
  readonly getAllComponents: (_: TSESTree$1.Program) => Map<string, ERClassComponent>;
@@ -146,6 +131,7 @@ declare const RE_COMPONENT_NAME: RegExp;
146
131
  declare function getComponentNameFromIdentifier(node: TSESTree.Identifier | TSESTree.Identifier[]): string;
147
132
  declare function isComponentName(name: string): boolean;
148
133
 
134
+ declare function isRenderMethodLike(node: TSESTree$1.Node): node is TSESTree$1.MethodDefinition | TSESTree$1.PropertyDefinition;
149
135
  declare function isFunctionOfRenderMethod(node: AST.TSESTreeFunction): boolean;
150
136
  /**
151
137
  * Check whether given node is declared inside class component's render block
@@ -164,6 +150,19 @@ declare function isFunctionOfRenderMethod(node: AST.TSESTreeFunction): boolean;
164
150
  */
165
151
  declare function isInsideRenderMethod(node: TSESTree$1.Node): boolean;
166
152
 
153
+ /**
154
+ * Check if a node is a React class component
155
+ * @param node The AST node to check
156
+ * @returns `true` if the node is a class component, `false` otherwise
157
+ */
158
+ declare function isClassComponent(node: TSESTree.Node): node is AST.TSESTreeClass;
159
+ /**
160
+ * Check if a node is a React PureComponent
161
+ * @param node The AST node to check
162
+ * @returns `true` if the node is a pure component, `false` otherwise
163
+ */
164
+ declare function isPureComponent(node: TSESTree.Node): boolean;
165
+
167
166
  declare function hasNoneOrValidComponentName(node: AST.TSESTreeFunction, context: RuleContext): boolean;
168
167
 
169
168
  type EREffectKind = "effect" | "insertionEffect" | "layoutEffect";
@@ -241,6 +240,11 @@ declare const isUseStateCall: (node: TSESTree.CallExpression, context: Readonly<
241
240
  declare const isUseSyncExternalStoreCall: (node: TSESTree.CallExpression, context: Readonly<_typescript_eslint_utils_ts_eslint.RuleContext<string, readonly unknown[]>>) => boolean;
242
241
  declare const isUseTransitionCall: (node: TSESTree.CallExpression, context: Readonly<_typescript_eslint_utils_ts_eslint.RuleContext<string, readonly unknown[]>>) => boolean;
243
242
 
243
+ declare function isComponentDidMount(node: TSESTree.Node): node is TSESTree.MethodDefinition | TSESTree.PropertyDefinition;
244
+ declare function isComponentWillUnmount(node: TSESTree.Node): node is TSESTree.MethodDefinition | TSESTree.PropertyDefinition;
245
+ declare function isComponentDidMountFunction(node: TSESTree.Node): boolean;
246
+ declare function isComponentWillUnmountFunction(node: TSESTree.Node): boolean;
247
+
244
248
  declare const ERPhaseRelevance: _eslint_react_types.BiRecord<{
245
249
  readonly mount: "unmount";
246
250
  readonly setup: "cleanup";
@@ -2569,4 +2573,4 @@ declare const isMemoCall: {
2569
2573
  (node: Node, context: _eslint_react_types.RuleContext): node is CallExpression;
2570
2574
  };
2571
2575
 
2572
- export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, getId, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfRenderMethod, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderPropLoose, isSetupFunction, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
2576
+ export { DEFAULT_COMPONENT_HINT, type ERClassComponent, ERClassComponentFlag, type ERComponent, ERComponentHint, type ERComponentKind, type EREffectKind, type EREffectMethodKind, type EREffectPhaseKind, type ERFunctionComponent, ERFunctionComponentFlag, type ERHook, type ERHookKind, type ERLifecycleMethodKind, type ERLifecyclePhaseKind, type ERPhaseKind, ERPhaseRelevance, type ERSemanticEntry, type ERSemanticNode, type ERStateKind, RE_COMPONENT_NAME, RE_HOOK_NAME, getComponentNameFromIdentifier, getElementRepresentName, getFunctionComponentIdentifier, getId, hasNoneOrValidComponentName, isCallFromReact, isCallFromReactMember, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCleanupFunction, isCloneElement, isCloneElementCall, isComponentDidMount, isComponentDidMountFunction, isComponentName, isComponentWillUnmount, isComponentWillUnmountFunction, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFromReact, isFromReactMember, isFunctionOfRenderMethod, isInitializedFromReact, isInsideCreateElementProps, isInsideReactHook, isInsideRenderMethod, isInversePhase, isMemo, isMemoCall, isPureComponent, isReactAPICallWithName, isReactAPIWithName, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookName, isRenderFunctionLoose, isRenderMethodLike, isRenderPropLoose, isSetupFunction, isThisSetState, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, useComponentCollector, useComponentCollectorLegacy, useHookCollector };