ITADN

prefer-immutable-types "ErrorType encountered."

#946Closedgajus 创建于 2025-03-22
Type: BugStatus: Triage
G
gajuscommented
Not sure how to isolate the issue. It originates from here: ``` eslint-plugin-sql/node_modules/is-immutable-type/dist/index.mjs:118:15 ``` which is this: ```ts function getTypeData(type, typeNode) { if (isIntrinsicErrorType(type)) { throw new Error("ErrorType encountered."); } return { type, typeNode: typeNode === undefined || typeNode === null || isAnonymousTypeNode(typeNode) ? null : typeNode, }; } ``` If I inspect `type`, it is: ``` type TypeObject { flags: 1, checker: { getNodeCount: [Function: getNodeCount], getIdentifierCount: [Function: getIdentifierCount], getSymbolCount: [Function: getSymbolCount], getTypeCount: [Function: getTypeCount], getInstantiationCount: [Function: getInstantiationCount], getRelationCacheSizes: [Function: getRelationCacheSizes], isUndefinedSymbol: [Function: isUndefinedSymbol], isArgumentsSymbol: [Function: isArgumentsSymbol], isUnknownSymbol: [Function: isUnknownSymbol], getMergedSymbol: [Function: getMergedSymbol], symbolIsValue: [Function: symbolIsValue], getDiagnostics: [Function: getDiagnostics2], getGlobalDiagnostics: [Function: getGlobalDiagnostics], getRecursionIdentity: [Function: getRecursionIdentity], getUnmatchedProperties: [GeneratorFunction: getUnmatchedProperties], getTypeOfSymbolAtLocation: [Function: getTypeOfSymbolAtLocation], getTypeOfSymbol: [Function: getTypeOfSymbol], getSymbolsOfParameterPropertyDeclaration: [Function: getSymbolsOfParameterPropertyDeclaration], getDeclaredTypeOfSymbol: [Function: getDeclaredTypeOfSymbol], getPropertiesOfType: [Function: getPropertiesOfType], getPropertyOfType: [Function: getPropertyOfType], getPrivateIdentifierPropertyOfType: [Function: getPrivateIdentifierPropertyOfType], getTypeOfPropertyOfType: [Function: getTypeOfPropertyOfType], getIndexInfoOfType: [Function: getIndexInfoOfType], getIndexInfosOfType: [Function: getIndexInfosOfType], getIndexInfosOfIndexSymbol: [Function: getIndexInfosOfIndexSymbol], getSignaturesOfType: [Function: getSignaturesOfType], getIndexTypeOfType: [Function: getIndexTypeOfType], getIndexType: [Function: getIndexType], getBaseTypes: [Function: getBaseTypes], getBaseTypeOfLiteralType: [Function: getBaseTypeOfLiteralType], getWidenedType: [Function: getWidenedType], getWidenedLiteralType: [Function: getWidenedLiteralType], fillMissingTypeArguments: [Function: fillMissingTypeArguments], getTypeFromTypeNode: [Function: getTypeFromTypeNode], getParameterType: [Function: getTypeAtPosition], getParameterIdentifierInfoAtPosition: [Function: getParameterIdentifierInfoAtPosition], getPromisedTypeOfPromise: [Function: getPromisedTypeOfPromise], getAwaitedType: [Function: getAwaitedType], getReturnTypeOfSignature: [Function: getReturnTypeOfSignature], isNullableType: [Function: isNullableType], getNullableType: [Function: getNullableType], getNonNullableType: [Function: getNonNullableType], getNonOptionalType: [Function: removeOptionalTypeMarker], getTypeArguments: [Function: getTypeArguments], typeToTypeNode: [Function: typeToTypeNode], typePredicateToTypePredicateNode: [Function: typePredicateToTypePredicateNode], indexInfoToIndexSignatureDeclaration: [Function: indexInfoToIndexSignatureDeclaration], signatureToSignatureDeclaration: [Function: signatureToSignatureDeclaration], symbolToEntityName: [Function: symbolToEntityName], symbolToExpression: [Function: symbolToExpression], symbolToNode: [Function: symbolToNode], symbolToTypeParameterDeclarations: [Function: symbolToTypeParameterDeclarations], symbolToParameterDeclaration: [Function: symbolToParameterDeclaration], typeParameterToDeclaration: [Function: typeParameterToDeclaration], getSymbolsInScope: [Function: getSymbolsInScope], getSymbolAtLocation: [Function: getSymbolAtLocation], getIndexInfosAtLocation: [Function: getIndexInfosAtLocation], getShorthandAssignmentValueSymbol: [Function: getShorthandAssignmentValueSymbol], getExportSpecifierLocalTargetSymbol: [Function: getExportSpecifierLocalTargetSymbol], getExportSymbolOfSymbol: [Function: getExportSymbolOfSymbol], getTypeAtLocation: [Function: getTypeAtLocation], getTypeOfAssignmentPattern: [Function: getTypeOfAssignmentPattern], getPropertySymbolOfDestructuringAssignment: [Function: getPropertySymbolOfDestructuringAssignment], signatureToString: [Function: signatureToString], typeToString: [Function: typeToString], symbolToString: [Function: symbolToString], typePredicateToString: [Function: typePredicateToString], writeSignature: [Function: writeSignature], writeType: [Function: writeType], writeSymbol: [Function: writeSymbol], writeTypePredicate: [Function: writeTypePredicate], getAugmentedPropertiesOfType: [Function: getAugmentedPropertiesOfType], getRootSymbols: [Function: getRootSymbols], getSymbolOfExpando: [Function: getSymbolOfExpando], getContextualType: [Function: getContextualType], getContextualTypeForObjectLiteralElement: [Function: getContextualTypeForObjectLiteralElement], getContextualTypeForArgumentAtIndex: [Function: getContextualTypeForArgumentAtIndex], getContextualTypeForJsxAttribute: [Function: getContextualTypeForJsxAttribute], isContextSensitive: [Function: isContextSensitive], getTypeOfPropertyOfContextualType: [Function: getTypeOfPropertyOfContextualType], getFullyQualifiedName: [Function: getFullyQualifiedName], getResolvedSignature: [Function: getResolvedSignature], getCandidateSignaturesForStringLiteralCompletions: [Function: getCandidateSignaturesForStringLiteralCompletions], getResolvedSignatureForSignatureHelp: [Function: getResolvedSignatureForSignatureHelp], getExpandedParameters: [Function: getExpandedParameters], hasEffectiveRestParameter: [Function: hasEffectiveRestParameter], containsArgumentsReference: [Function: containsArgumentsReference], getConstantValue: [Function: getConstantValue], isValidPropertyAccess: [Function: isValidPropertyAccess], isValidPropertyAccessForCompletions: [Function: isValidPropertyAccessForCompletions], getSignatureFromDeclaration: [Function: getSignatureFromDeclaration], isImplementationOfOverload: [Function: isImplementationOfOverload], getImmediateAliasedSymbol: [Function: getImmediateAliasedSymbol], getAliasedSymbol: [Function: resolveAlias], getEmitResolver: [Function: getEmitResolver], requiresAddingImplicitUndefined: [Function: requiresAddingImplicitUndefined], getExportsOfModule: [Function: getExportsOfModuleAsArray], getExportsAndPropertiesOfModule: [Function: getExportsAndPropertiesOfModule], forEachExportAndPropertyOfModule: [Function: forEachExportAndPropertyOfModule], getSymbolWalker: [Function: getSymbolWalker], getAmbientModules: [Function: getAmbientModules], getJsxIntrinsicTagNamesAt: [Function: getJsxIntrinsicTagNamesAt], isOptionalParameter: [Function: isOptionalParameter], tryGetMemberInModuleExports: [Function: tryGetMemberInModuleExports], tryGetMemberInModuleExportsAndProperties: [Function: tryGetMemberInModuleExportsAndProperties], tryFindAmbientModule: [Function: tryFindAmbientModule], getApparentType: [Function: getApparentType], getUnionType: [Function: getUnionType], isTypeAssignableTo: [Function: isTypeAssignableTo], createAnonymousType: [Function: createAnonymousType], createSignature: [Function: createSignature], createSymbol: [Function: createSymbol], createIndexInfo: [Function: createIndexInfo], getAnyType: [Function: getAnyType], getStringType: [Function: getStringType], getStringLiteralType: [Function: getStringLiteralType], getNumberType: [Function: getNumberType], getNumberLiteralType: [Function: getNumberLiteralType], getBigIntType: [Function: getBigIntType], getBigIntLiteralType: [Function: getBigIntLiteralType], getUnknownType: [Function: getUnknownType], createPromiseType: [Function: createPromiseType], createArrayType: [Function: createArrayType], getElementTypeOfArrayType: [Function: getElementTypeOfArrayType], getBooleanType: [Function: getBooleanType], getFalseType: [Function: getFalseType], getTrueType: [Function: getTrueType], getVoidType: [Function: getVoidType], getUndefinedType: [Function: getUndefinedType], getNullType: [Function: getNullType], getESSymbolType: [Function: getESSymbolType], getNeverType: [Function: getNeverType], getOptionalType: [Function: getOptionalType], getPromiseType: [Function: getPromiseType], getPromiseLikeType: [Function: getPromiseLikeType], getAnyAsyncIterableType: [Function: getAnyAsyncIterableType], isSymbolAccessible: [Function: isSymbolAccessible], isArrayType: [Function: isArrayType], isTupleType: [Function: isTupleType], isArrayLikeType: [Function: isArrayLikeType], isEmptyAnonymousObjectType: [Function: isEmptyAnonymousObjectType], isTypeInvalidDueToUnionDiscriminant: [Function: isTypeInvalidDueToUnionDiscriminant], getExactOptionalProperties: [Function: getExactOptionalProperties], getAllPossiblePropertiesOfTypes: [Function: getAllPossiblePropertiesOfTypes], getSuggestedSymbolForNonexistentProperty: [Function: getSuggestedSymbolForNonexistentProperty], getSuggestedSymbolForNonexistentJSXAttribute: [Function: getSuggestedSymbolForNonexistentJSXAttribute], getSuggestedSymbolForNonexistentSymbol: [Function: getSuggestedSymbolForNonexistentSymbol], getSuggestedSymbolForNonexistentModule: [Function: getSuggestedSymbolForNonexistentModule], getSuggestedSymbolForNonexistentClassMember: [Function: getSuggestedSymbolForNonexistentClassMember], getBaseConstraintOfType: [Function: getBaseConstraintOfType], getDefaultFromTypeParameter: [Function: getDefaultFromTypeParameter], resolveName: [Function: resolveName], getJsxNamespace: [Function: getJsxNamespace], getJsxFragmentFactory: [Function: getJsxFragmentFactory], getAccessibleSymbolChain: [Function: getAccessibleSymbolChain], getTypePredicateOfSignature: [Function: getTypePredicateOfSignature], resolveExternalModuleName: [Function: resolveExternalModuleName], resolveExternalModuleSymbol: [Function: resolveExternalModuleSymbol], tryGetThisTypeAt: [Function: tryGetThisTypeAt], getTypeArgumentConstraint: [Function: getTypeArgumentConstraint], getSuggestionDiagnostics: [Function: getSuggestionDiagnostics], runWithCancellationToken: [Function: runWithCancellationToken], getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: [Function: getLocalTypeParametersOfClassOrInterfaceOrTypeAlias], isDeclarationVisible: [Function: isDeclarationVisible], isPropertyAccessible: [Function: isPropertyAccessible], getTypeOnlyAliasDeclaration: [Function: getTypeOnlyAliasDeclaration], getMemberOverrideModifierStatus: [Function: getMemberOverrideModifierStatus], isTypeParameterPossiblyReferenced: [Function: isTypeParameterPossiblyReferenced], typeHasCallOrConstructSignatures: [Function: typeHasCallOrConstructSignatures], getSymbolFlags: [Function: getSymbolFlags], getTypeArgumentsForResolvedSignature: [Function: getTypeArgumentsForResolvedSignature] }, id: 5, intrinsicName: 'error', debugIntrinsicName: undefined, objectFlags: 52953088 } ``` `typeNode` is `undefined`.
关闭于 2025-03-22 2 条评论