diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 80ad73a4b8d..f4e97108e52 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12882,7 +12882,7 @@ namespace ts { case SyntaxKind.NeverKeyword: return neverType; case SyntaxKind.ObjectKeyword: - return node.flags & NodeFlags.JavaScriptFile ? anyType : nonPrimitiveType; + return node.flags & NodeFlags.JavaScriptFile && !noImplicitAny ? anyType : nonPrimitiveType; case SyntaxKind.ThisType: case SyntaxKind.ThisKeyword: return getTypeFromThisTypeNode(node as ThisExpression | ThisTypeNode);