fix: disallow line break between async and property (#11947)

This commit is contained in:
Huáng Jùnliàng 2020-08-10 18:33:14 -04:00 committed by GitHub
parent 008fe25ae2
commit 3bff1ce35a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 0 deletions

View File

@ -37,6 +37,8 @@ export function _methodHead(node: Object) {
} }
if (node.async) { if (node.async) {
// ensure `async` is in the same line with property name
this._catchUp("start", key.loc);
this.word("async"); this.word("async");
this.space(); this.space();
} }

View File

@ -0,0 +1,4 @@
class Test {
@TestDecorator
async decorateMe() {}
}

View File

@ -0,0 +1,4 @@
{
"retainLines": true,
"plugins": [["decorators", { "decoratorsBeforeExport": true }]]
}

View File

@ -0,0 +1,3 @@
class Test {
@TestDecorator
async decorateMe() {}}