From 7f8bf731bdc761cea94c1881a734359d5e37ff04 Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Sun, 29 Nov 2015 15:16:30 -0800 Subject: [PATCH] fix lint errors --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6677d14b72f..a803bd8ba42 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9882,14 +9882,14 @@ namespace ts { } const hasExplicitReturn = func.flags & NodeFlags.HasExplicitReturn; - + if (returnType && !hasExplicitReturn) { // minimal check: function has syntactic return type annotation and no explicit return statements in the body // this function does not conform to the specification. // NOTE: having returnType !== undefined is a precondition for entering this branch so func.type will always be present error(func.type, Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value); } - else if (compilerOptions.noImplicitReturns){ + else if (compilerOptions.noImplicitReturns) { // errors in this branch should only be reported if CompilerOptions.noImplicitReturns flag is set if (!returnType) { // If return type annotation is omitted check if function has any explicit return statements. @@ -9898,7 +9898,7 @@ namespace ts { const inferredReturnType = hasExplicitReturn ? getReturnTypeOfSignature(getSignatureFromDeclaration(func)) : voidType; - + if (inferredReturnType === voidType || isTypeAny(inferredReturnType)) { return; }