@eslint-react/core 2.0.0-beta.19 → 2.0.0-beta.20
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 +96 -1
- package/dist/index.js +72 -1
- package/package.json +7 -6
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { unit } from '@eslint-react/eff';
|
|
|
6
6
|
import * as birecord from 'birecord';
|
|
7
7
|
import { Scope } from '@typescript-eslint/scope-manager';
|
|
8
8
|
import * as VAR from '@eslint-react/var';
|
|
9
|
+
import ts from 'typescript';
|
|
10
|
+
export { isFalseLiteralType, isTrueLiteralType } from 'ts-api-utils';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Determines whether inside `createElement`'s children.
|
|
@@ -486,6 +488,99 @@ declare function isFragmentElement(context: RuleContext, node: TSESTree.Node | n
|
|
|
486
488
|
*/
|
|
487
489
|
declare function stringifyJsx(node: TSESTree$1.JSXIdentifier | TSESTree$1.JSXMemberExpression | TSESTree$1.JSXNamespacedName | TSESTree$1.JSXOpeningElement | TSESTree$1.JSXClosingElement | TSESTree$1.JSXOpeningFragment | TSESTree$1.JSXClosingFragment | TSESTree$1.JSXText): string;
|
|
488
490
|
|
|
491
|
+
declare const isAnyType: (type: ts.Type) => boolean;
|
|
492
|
+
declare const isBigIntType: (type: ts.Type) => boolean;
|
|
493
|
+
declare const isBooleanType: (type: ts.Type) => boolean;
|
|
494
|
+
declare const isEnumType: (type: ts.Type) => boolean;
|
|
495
|
+
declare const isFalsyBigIntType: (type: ts.Type) => type is ts.LiteralType & {
|
|
496
|
+
freshType: ts.FreshableType;
|
|
497
|
+
regularType: ts.FreshableType;
|
|
498
|
+
flags: ts.TypeFlags;
|
|
499
|
+
symbol: ts.Symbol;
|
|
500
|
+
pattern?: ts.DestructuringPattern;
|
|
501
|
+
aliasSymbol?: ts.Symbol;
|
|
502
|
+
aliasTypeArguments?: readonly ts.Type[];
|
|
503
|
+
getFlags: () => ts.TypeFlags;
|
|
504
|
+
getSymbol: () => ts.Symbol | undefined;
|
|
505
|
+
getProperties: () => ts.Symbol[];
|
|
506
|
+
getProperty: (propertyName: string) => ts.Symbol | undefined;
|
|
507
|
+
getApparentProperties: () => ts.Symbol[];
|
|
508
|
+
getCallSignatures: () => readonly ts.Signature[];
|
|
509
|
+
getConstructSignatures: () => readonly ts.Signature[];
|
|
510
|
+
getStringIndexType: () => ts.Type | undefined;
|
|
511
|
+
getNumberIndexType: () => ts.Type | undefined;
|
|
512
|
+
getBaseTypes: () => ts.BaseType[] | undefined;
|
|
513
|
+
getNonNullableType: () => ts.Type;
|
|
514
|
+
getConstraint: () => ts.Type | undefined;
|
|
515
|
+
getDefault: () => ts.Type | undefined;
|
|
516
|
+
isUnion: () => this is ts.UnionType;
|
|
517
|
+
isIntersection: () => this is ts.IntersectionType;
|
|
518
|
+
isUnionOrIntersection: () => this is ts.UnionOrIntersectionType;
|
|
519
|
+
isLiteral: () => this is ts.LiteralType;
|
|
520
|
+
isStringLiteral: () => this is ts.StringLiteralType;
|
|
521
|
+
isNumberLiteral: () => this is ts.NumberLiteralType;
|
|
522
|
+
isTypeParameter: () => this is ts.TypeParameter;
|
|
523
|
+
isClassOrInterface: () => this is ts.InterfaceType;
|
|
524
|
+
isClass: () => this is ts.InterfaceType;
|
|
525
|
+
isIndexType: () => this is ts.IndexType;
|
|
526
|
+
value: {
|
|
527
|
+
negative: boolean;
|
|
528
|
+
base10Value: "0";
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
declare const isFalsyNumberType: (type: ts.Type) => boolean;
|
|
532
|
+
declare const isFalsyStringType: (type: ts.Type) => boolean;
|
|
533
|
+
declare const isNeverType: (type: ts.Type) => boolean;
|
|
534
|
+
declare const isNullishType: (type: ts.Type) => boolean;
|
|
535
|
+
declare const isNumberType: (type: ts.Type) => boolean;
|
|
536
|
+
declare const isObjectType: (type: ts.Type) => boolean;
|
|
537
|
+
declare const isStringType: (type: ts.Type) => boolean;
|
|
538
|
+
declare const isTruthyBigIntType: (type: ts.Type) => type is ts.LiteralType & {
|
|
539
|
+
freshType: ts.FreshableType;
|
|
540
|
+
regularType: ts.FreshableType;
|
|
541
|
+
flags: ts.TypeFlags;
|
|
542
|
+
symbol: ts.Symbol;
|
|
543
|
+
pattern?: ts.DestructuringPattern;
|
|
544
|
+
aliasSymbol?: ts.Symbol;
|
|
545
|
+
aliasTypeArguments?: readonly ts.Type[];
|
|
546
|
+
getFlags: () => ts.TypeFlags;
|
|
547
|
+
getSymbol: () => ts.Symbol | undefined;
|
|
548
|
+
getProperties: () => ts.Symbol[];
|
|
549
|
+
getProperty: (propertyName: string) => ts.Symbol | undefined;
|
|
550
|
+
getApparentProperties: () => ts.Symbol[];
|
|
551
|
+
getCallSignatures: () => readonly ts.Signature[];
|
|
552
|
+
getConstructSignatures: () => readonly ts.Signature[];
|
|
553
|
+
getStringIndexType: () => ts.Type | undefined;
|
|
554
|
+
getNumberIndexType: () => ts.Type | undefined;
|
|
555
|
+
getBaseTypes: () => ts.BaseType[] | undefined;
|
|
556
|
+
getNonNullableType: () => ts.Type;
|
|
557
|
+
getConstraint: () => ts.Type | undefined;
|
|
558
|
+
getDefault: () => ts.Type | undefined;
|
|
559
|
+
isUnion: () => this is ts.UnionType;
|
|
560
|
+
isIntersection: () => this is ts.IntersectionType;
|
|
561
|
+
isUnionOrIntersection: () => this is ts.UnionOrIntersectionType;
|
|
562
|
+
isLiteral: () => this is ts.LiteralType;
|
|
563
|
+
isStringLiteral: () => this is ts.StringLiteralType;
|
|
564
|
+
isNumberLiteral: () => this is ts.NumberLiteralType;
|
|
565
|
+
isTypeParameter: () => this is ts.TypeParameter;
|
|
566
|
+
isClassOrInterface: () => this is ts.InterfaceType;
|
|
567
|
+
isClass: () => this is ts.InterfaceType;
|
|
568
|
+
isIndexType: () => this is ts.IndexType;
|
|
569
|
+
value: ts.PseudoBigInt;
|
|
570
|
+
};
|
|
571
|
+
declare const isTruthyNumberType: (type: ts.Type) => boolean;
|
|
572
|
+
declare const isTruthyStringType: (type: ts.Type) => boolean;
|
|
573
|
+
declare const isUnknownType: (type: ts.Type) => boolean;
|
|
574
|
+
|
|
575
|
+
type TypeVariant = "any" | "bigint" | "boolean" | "enum" | "never" | "nullish" | "number" | "object" | "string" | "unknown" | "falsy bigint" | "falsy boolean" | "falsy number" | "falsy string" | "truthy bigint" | "truthy boolean" | "truthy number" | "truthy string";
|
|
576
|
+
/**
|
|
577
|
+
* Ported from https://github.com/typescript-eslint/typescript-eslint/blob/eb736bbfc22554694400e6a4f97051d845d32e0b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts#L826 with some enhancements
|
|
578
|
+
* Get the variants of an array of types.
|
|
579
|
+
* @param types The types to get the variants of
|
|
580
|
+
* @returns The variants of the types
|
|
581
|
+
*/
|
|
582
|
+
declare function getTypeVariants(types: ts.Type[]): Set<TypeVariant>;
|
|
583
|
+
|
|
489
584
|
/** @internal */
|
|
490
585
|
declare function getInstanceId(node: TSESTree.Node, prev?: TSESTree.Node): TSESTree.ArrayExpression | TSESTree.ArrayPattern | TSESTree.ArrowFunctionExpression | TSESTree.AssignmentExpression | TSESTree.AwaitExpression | TSESTree.BinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.ClassExpression | TSESTree.ConditionalExpression | TSESTree.FunctionExpression | TSESTree.Identifier | TSESTree.ImportExpression | TSESTree.JSXElement | TSESTree.JSXFragment | TSESTree.BigIntLiteral | TSESTree.BooleanLiteral | TSESTree.NullLiteral | TSESTree.NumberLiteral | TSESTree.RegExpLiteral | TSESTree.StringLiteral | TSESTree.LogicalExpression | TSESTree.MemberExpressionComputedName | TSESTree.MemberExpressionNonComputedName | TSESTree.MetaProperty | TSESTree.NewExpression | TSESTree.ObjectExpression | TSESTree.ObjectPattern | TSESTree.PrivateIdentifier | TSESTree.SequenceExpression | TSESTree.Super | TSESTree.TaggedTemplateExpression | TSESTree.TemplateLiteral | TSESTree.ThisExpression | TSESTree.TSAsExpression | TSESTree.TSInstantiationExpression | TSESTree.TSNonNullExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion | TSESTree.UnaryExpression | TSESTree.UpdateExpression | TSESTree.YieldExpression | undefined;
|
|
491
586
|
|
|
@@ -542,4 +637,4 @@ declare const isForwardRefCall: isReactAPICall.ReturnType;
|
|
|
542
637
|
declare const isMemoCall: isReactAPICall.ReturnType;
|
|
543
638
|
declare const isLazyCall: isReactAPICall.ReturnType;
|
|
544
639
|
|
|
545
|
-
export { type ClassComponent, type Component, ComponentDetectionHint, type ComponentEffectPhaseKind, ComponentFlag, type ComponentKind, type ComponentLifecyclePhaseKind, type ComponentPhaseKind, ComponentPhaseRelevance, type ComponentStateKind, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, type EffectKind, type FunctionComponent, type Hook, JSXDetectionHint, REACT_BUILTIN_HOOK_NAMES, type SemanticEntry, type SemanticNode, findParentAttribute, getAttribute, getAttributeName, getAttributeValue, getComponentFlagFromInitPath, getComponentNameFromId, getElementType, getFunctionComponentId, getInstanceId, hasAnyAttribute, hasAttribute, hasEveryAttribute, hasNoneOrLooseComponentName, isAssignmentToThisState, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentDidUpdate, isComponentName, isComponentNameLoose, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUpdate, isComponentWrapperCall, isComponentWrapperCallLoose, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFragmentElement, isFunctionOfRender, isFunctionOfRenderMethod, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isHostElement, isInitializedFromReact, isInstanceIdEqual, isInversePhase, isJsxLike, isJsxText, isKeyedElement, isLazy, isLazyCall, isMemo, isMemoCall, isPureComponent, isReactAPI, isReactAPICall, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookId, isReactHookName, isRenderFunctionLoose, isRenderLike, isRenderMethodLike, isRenderPropLoose, isShouldComponentUpdate, isThisSetState, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUseActionStateCall, isUseCall, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseFormStatusCall, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseOptimisticCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, isValidComponentDefinition, stringifyJsx, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
|
640
|
+
export { type ClassComponent, type Component, ComponentDetectionHint, type ComponentEffectPhaseKind, ComponentFlag, type ComponentKind, type ComponentLifecyclePhaseKind, type ComponentPhaseKind, ComponentPhaseRelevance, type ComponentStateKind, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, type EffectKind, type FunctionComponent, type Hook, JSXDetectionHint, REACT_BUILTIN_HOOK_NAMES, type SemanticEntry, type SemanticNode, type TypeVariant, findParentAttribute, getAttribute, getAttributeName, getAttributeValue, getComponentFlagFromInitPath, getComponentNameFromId, getElementType, getFunctionComponentId, getInstanceId, getTypeVariants, hasAnyAttribute, hasAttribute, hasEveryAttribute, hasNoneOrLooseComponentName, isAnyType, isAssignmentToThisState, isBigIntType, isBooleanType, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentDidUpdate, isComponentName, isComponentNameLoose, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUpdate, isComponentWrapperCall, isComponentWrapperCallLoose, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isEnumType, isFalsyBigIntType, isFalsyNumberType, isFalsyStringType, isForwardRef, isForwardRefCall, isFragmentElement, isFunctionOfRender, isFunctionOfRenderMethod, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isHostElement, isInitializedFromReact, isInstanceIdEqual, isInversePhase, isJsxLike, isJsxText, isKeyedElement, isLazy, isLazyCall, isMemo, isMemoCall, isNeverType, isNullishType, isNumberType, isObjectType, isPureComponent, isReactAPI, isReactAPICall, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookId, isReactHookName, isRenderFunctionLoose, isRenderLike, isRenderMethodLike, isRenderPropLoose, isShouldComponentUpdate, isStringType, isThisSetState, isTruthyBigIntType, isTruthyNumberType, isTruthyStringType, isUnknownType, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUseActionStateCall, isUseCall, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseFormStatusCall, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseOptimisticCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, isValidComponentDefinition, stringifyJsx, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,9 @@ import { coerceSettings, DEFAULT_ESLINT_REACT_SETTINGS, getId } from '@eslint-re
|
|
|
6
6
|
import * as VAR3 from '@eslint-react/var';
|
|
7
7
|
import { isMatching, P, match } from 'ts-pattern';
|
|
8
8
|
import birecord from 'birecord';
|
|
9
|
+
import { isTypeFlagSet, isFalseLiteralType, isTrueLiteralType } from 'ts-api-utils';
|
|
10
|
+
export { isFalseLiteralType, isTrueLiteralType } from 'ts-api-utils';
|
|
11
|
+
import ts from 'typescript';
|
|
9
12
|
|
|
10
13
|
// src/component/component-children.ts
|
|
11
14
|
function isReactAPI(api) {
|
|
@@ -961,5 +964,73 @@ function isAssignmentToThisState(node) {
|
|
|
961
964
|
const { left } = node;
|
|
962
965
|
return left.type === AST_NODE_TYPES.MemberExpression && AST14.isThisExpression(left.object) && AST14.getPropertyName(left.property) === "state";
|
|
963
966
|
}
|
|
967
|
+
var isAnyType = (type) => isTypeFlagSet(type, ts.TypeFlags.TypeParameter | ts.TypeFlags.Any);
|
|
968
|
+
var isBigIntType = (type) => isTypeFlagSet(type, ts.TypeFlags.BigIntLike);
|
|
969
|
+
var isBooleanType = (type) => isTypeFlagSet(type, ts.TypeFlags.BooleanLike);
|
|
970
|
+
var isEnumType = (type) => isTypeFlagSet(type, ts.TypeFlags.EnumLike);
|
|
971
|
+
var isFalsyBigIntType = (type) => type.isLiteral() && isMatching({ value: { base10Value: "0" } }, type);
|
|
972
|
+
var isFalsyNumberType = (type) => type.isNumberLiteral() && type.value === 0;
|
|
973
|
+
var isFalsyStringType = (type) => type.isStringLiteral() && type.value === "";
|
|
974
|
+
var isNeverType = (type) => isTypeFlagSet(type, ts.TypeFlags.Never);
|
|
975
|
+
var isNullishType = (type) => isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike);
|
|
976
|
+
var isNumberType = (type) => isTypeFlagSet(type, ts.TypeFlags.NumberLike);
|
|
977
|
+
var isObjectType = (type) => !isTypeFlagSet(
|
|
978
|
+
type,
|
|
979
|
+
ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike | ts.TypeFlags.BooleanLike | ts.TypeFlags.StringLike | ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike | ts.TypeFlags.TypeParameter | ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.Never
|
|
980
|
+
);
|
|
981
|
+
var isStringType = (type) => isTypeFlagSet(type, ts.TypeFlags.StringLike);
|
|
982
|
+
var isTruthyBigIntType = (type) => type.isLiteral() && isMatching({ value: { base10Value: P.not("0") } }, type);
|
|
983
|
+
var isTruthyNumberType = (type) => type.isNumberLiteral() && type.value !== 0;
|
|
984
|
+
var isTruthyStringType = (type) => type.isStringLiteral() && type.value !== "";
|
|
985
|
+
var isUnknownType = (type) => isTypeFlagSet(type, ts.TypeFlags.Unknown);
|
|
986
|
+
function getTypeVariants(types) {
|
|
987
|
+
const variants = /* @__PURE__ */ new Set();
|
|
988
|
+
if (types.some(isUnknownType)) {
|
|
989
|
+
variants.add("unknown");
|
|
990
|
+
return variants;
|
|
991
|
+
}
|
|
992
|
+
if (types.some(isNullishType)) {
|
|
993
|
+
variants.add("nullish");
|
|
994
|
+
}
|
|
995
|
+
const booleans = types.filter(isBooleanType);
|
|
996
|
+
const boolean0 = booleans[0];
|
|
997
|
+
if (booleans.length === 1 && boolean0 != null) {
|
|
998
|
+
if (isFalseLiteralType(boolean0)) {
|
|
999
|
+
variants.add("falsy boolean");
|
|
1000
|
+
} else if (isTrueLiteralType(boolean0)) {
|
|
1001
|
+
variants.add("truthy boolean");
|
|
1002
|
+
}
|
|
1003
|
+
} else if (booleans.length === 2) {
|
|
1004
|
+
variants.add("boolean");
|
|
1005
|
+
}
|
|
1006
|
+
const strings = types.filter(isStringType);
|
|
1007
|
+
if (strings.length > 0) {
|
|
1008
|
+
const evaluated = match(strings).when((types2) => types2.every(isTruthyStringType), () => "truthy string").when((types2) => types2.every(isFalsyStringType), () => "falsy string").otherwise(() => "string");
|
|
1009
|
+
variants.add(evaluated);
|
|
1010
|
+
}
|
|
1011
|
+
const bigints = types.filter(isBigIntType);
|
|
1012
|
+
if (bigints.length > 0) {
|
|
1013
|
+
const evaluated = match(bigints).when((types2) => types2.every(isTruthyBigIntType), () => "truthy bigint").when((types2) => types2.every(isFalsyBigIntType), () => "falsy bigint").otherwise(() => "bigint");
|
|
1014
|
+
variants.add(evaluated);
|
|
1015
|
+
}
|
|
1016
|
+
const numbers = types.filter(isNumberType);
|
|
1017
|
+
if (numbers.length > 0) {
|
|
1018
|
+
const evaluated = match(numbers).when((types2) => types2.every(isTruthyNumberType), () => "truthy number").when((types2) => types2.every(isFalsyNumberType), () => "falsy number").otherwise(() => "number");
|
|
1019
|
+
variants.add(evaluated);
|
|
1020
|
+
}
|
|
1021
|
+
if (types.some(isEnumType)) {
|
|
1022
|
+
variants.add("enum");
|
|
1023
|
+
}
|
|
1024
|
+
if (types.some(isObjectType)) {
|
|
1025
|
+
variants.add("object");
|
|
1026
|
+
}
|
|
1027
|
+
if (types.some(isAnyType)) {
|
|
1028
|
+
variants.add("any");
|
|
1029
|
+
}
|
|
1030
|
+
if (types.some(isNeverType)) {
|
|
1031
|
+
variants.add("never");
|
|
1032
|
+
}
|
|
1033
|
+
return variants;
|
|
1034
|
+
}
|
|
964
1035
|
|
|
965
|
-
export { ComponentDetectionHint, ComponentFlag, ComponentPhaseRelevance, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, JSXDetectionHint, REACT_BUILTIN_HOOK_NAMES, findParentAttribute, getAttribute, getAttributeName, getAttributeValue, getComponentFlagFromInitPath, getComponentNameFromId, getElementType, getFunctionComponentId, getInstanceId, hasAnyAttribute, hasAttribute, hasEveryAttribute, hasNoneOrLooseComponentName, isAssignmentToThisState, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentDidUpdate, isComponentName, isComponentNameLoose, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUpdate, isComponentWrapperCall, isComponentWrapperCallLoose, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isForwardRef, isForwardRefCall, isFragmentElement, isFunctionOfRender, isFunctionOfRenderMethod, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isHostElement, isInitializedFromReact, isInstanceIdEqual, isInversePhase, isJsxLike, isJsxText, isKeyedElement, isLazy, isLazyCall, isMemo, isMemoCall, isPureComponent, isReactAPI, isReactAPICall, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookId, isReactHookName, isRenderFunctionLoose, isRenderLike, isRenderMethodLike, isRenderPropLoose, isShouldComponentUpdate, isThisSetState, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUseActionStateCall, isUseCall, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseFormStatusCall, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseOptimisticCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, isValidComponentDefinition, stringifyJsx, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
|
1036
|
+
export { ComponentDetectionHint, ComponentFlag, ComponentPhaseRelevance, DEFAULT_COMPONENT_DETECTION_HINT, DEFAULT_JSX_DETECTION_HINT, JSXDetectionHint, REACT_BUILTIN_HOOK_NAMES, findParentAttribute, getAttribute, getAttributeName, getAttributeValue, getComponentFlagFromInitPath, getComponentNameFromId, getElementType, getFunctionComponentId, getInstanceId, getTypeVariants, hasAnyAttribute, hasAttribute, hasEveryAttribute, hasNoneOrLooseComponentName, isAnyType, isAssignmentToThisState, isBigIntType, isBooleanType, isCaptureOwnerStack, isCaptureOwnerStackCall, isChildrenCount, isChildrenCountCall, isChildrenForEach, isChildrenForEachCall, isChildrenMap, isChildrenMapCall, isChildrenOfCreateElement, isChildrenOnly, isChildrenOnlyCall, isChildrenToArray, isChildrenToArrayCall, isClassComponent, isCloneElement, isCloneElementCall, isComponentDidCatch, isComponentDidMount, isComponentDidUpdate, isComponentName, isComponentNameLoose, isComponentWillMount, isComponentWillReceiveProps, isComponentWillUnmount, isComponentWillUpdate, isComponentWrapperCall, isComponentWrapperCallLoose, isCreateContext, isCreateContextCall, isCreateElement, isCreateElementCall, isCreateRef, isCreateRefCall, isDeclaredInRenderPropLoose, isDirectValueOfRenderPropertyLoose, isEnumType, isFalsyBigIntType, isFalsyNumberType, isFalsyStringType, isForwardRef, isForwardRefCall, isFragmentElement, isFunctionOfRender, isFunctionOfRenderMethod, isGetChildContext, isGetDefaultProps, isGetDerivedStateFromError, isGetDerivedStateFromProps, isGetInitialState, isGetSnapshotBeforeUpdate, isHostElement, isInitializedFromReact, isInstanceIdEqual, isInversePhase, isJsxLike, isJsxText, isKeyedElement, isLazy, isLazyCall, isMemo, isMemoCall, isNeverType, isNullishType, isNumberType, isObjectType, isPureComponent, isReactAPI, isReactAPICall, isReactHook, isReactHookCall, isReactHookCallWithName, isReactHookCallWithNameAlias, isReactHookCallWithNameLoose, isReactHookId, isReactHookName, isRenderFunctionLoose, isRenderLike, isRenderMethodLike, isRenderPropLoose, isShouldComponentUpdate, isStringType, isThisSetState, isTruthyBigIntType, isTruthyNumberType, isTruthyStringType, isUnknownType, isUnsafeComponentWillMount, isUnsafeComponentWillReceiveProps, isUnsafeComponentWillUpdate, isUseActionStateCall, isUseCall, isUseCallbackCall, isUseContextCall, isUseDebugValueCall, isUseDeferredValueCall, isUseEffectCall, isUseEffectCallLoose, isUseFormStatusCall, isUseIdCall, isUseImperativeHandleCall, isUseInsertionEffectCall, isUseLayoutEffectCall, isUseMemoCall, isUseOptimisticCall, isUseReducerCall, isUseRefCall, isUseStateCall, isUseSyncExternalStoreCall, isUseTransitionCall, isValidComponentDefinition, stringifyJsx, useComponentCollector, useComponentCollectorLegacy, useHookCollector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.20",
|
|
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": {
|
|
@@ -32,12 +32,13 @@
|
|
|
32
32
|
"@typescript-eslint/types": "^8.38.0",
|
|
33
33
|
"@typescript-eslint/utils": "^8.38.0",
|
|
34
34
|
"birecord": "^0.1.1",
|
|
35
|
+
"ts-api-utils": "^2.1.0",
|
|
35
36
|
"ts-pattern": "^5.8.0",
|
|
36
|
-
"@eslint-react/
|
|
37
|
-
"@eslint-react/
|
|
38
|
-
"@eslint-react/
|
|
39
|
-
"@eslint-react/
|
|
40
|
-
"@eslint-react/
|
|
37
|
+
"@eslint-react/ast": "2.0.0-beta.20",
|
|
38
|
+
"@eslint-react/kit": "2.0.0-beta.20",
|
|
39
|
+
"@eslint-react/eff": "2.0.0-beta.20",
|
|
40
|
+
"@eslint-react/shared": "2.0.0-beta.20",
|
|
41
|
+
"@eslint-react/var": "2.0.0-beta.20"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"tsup": "^8.5.0",
|