From 4758d07ee8c7cd07c3be28f942063f3050b0dc91 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 30 Jul 2020 18:06:03 +0200 Subject: [PATCH] style(compiler): fix terminal warning (#2604) Add missing brackets to `@Method()` in terminal warning code example. --- .../transformers/decorators-to-static/method-decorator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/transformers/decorators-to-static/method-decorator.ts b/src/compiler/transformers/decorators-to-static/method-decorator.ts index 5a753eb849f..c3e7f1981f4 100644 --- a/src/compiler/transformers/decorators-to-static/method-decorator.ts +++ b/src/compiler/transformers/decorators-to-static/method-decorator.ts @@ -42,7 +42,7 @@ const parseMethodDecorator = (config: d.Config, diagnostics: d.Diagnostic[], tsS if (returnString === 'void') { const warn = buildWarn(diagnostics); warn.header = '@Method requires async'; - warn.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method async ${methodName}().`; + warn.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`; augmentDiagnosticWithNode(warn, method.name); returnString = 'Promise'; @@ -50,7 +50,7 @@ const parseMethodDecorator = (config: d.Config, diagnostics: d.Diagnostic[], tsS } else if (!isTypePromise(returnString)) { const err = buildError(diagnostics); err.header = '@Method requires async'; - err.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method async ${methodName}().`; + err.messageText = `External @Method() ${methodName}() must return a Promise.\n\n Consider prefixing the method with async, such as @Method() async ${methodName}().`; augmentDiagnosticWithNode(err, method.name); } }