Skip to content

Commit

Permalink
style(compiler): fix terminal warning (#2604)
Browse files Browse the repository at this point in the history
Add missing brackets to `@Method()` in terminal warning code example.
  • Loading branch information
tricki committed Jul 30, 2020
1 parent 8ac43a6 commit 4758d07
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -42,15 +42,15 @@ 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<void>';
signatureString = signatureString.replace(/=> void$/, '=> Promise<void>');
} 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);
}
}
Expand Down

0 comments on commit 4758d07

Please sign in to comment.