Skip to content

Commit ab993c2

Browse files
committed
Small fix
1 parent 33cbb82 commit ab993c2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/compiler/checker.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7529,9 +7529,11 @@ namespace ts {
75297529
}
75307530

75317531
function isAutoTypedProperty(symbol: Symbol) {
7532-
// A property is auto-typed in noImplicitAny mode when its declaration has no type annotation or initializer.
7532+
// A property is auto-typed when its declaration has no type annotation or initializer and we're in
7533+
// noImplicitAny mode or a .js file.
75337534
const declaration = symbol.valueDeclaration;
7534-
return noImplicitAny && declaration && isPropertyDeclaration(declaration) && !declaration.type && !declaration.initializer;
7535+
return declaration && isPropertyDeclaration(declaration) && !getEffectiveTypeAnnotationNode(declaration) &&
7536+
!declaration.initializer && (noImplicitAny || isInJSFile(declaration));
75357537
}
75367538

75377539
function getDeclaringConstructor(symbol: Symbol) {

0 commit comments

Comments
 (0)