Skip to content

Conversation

@andrewbranch
Copy link
Member

Fixes #33522

Copy link
Contributor

@Kingwl Kingwl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks

index: 0,
newFileContent:
`async function fn(a: Promise<{ x: string }>) {
console.log(3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this have ; after console.log and on that line instead of next line ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the typical preferred style for non-semicoloners. See https://standardjs.com/rules.html#semicolons

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/cc @orta to confirm people actually do this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prettier does it this way, to which I give more credence than StandardJS anyway. I feel good about keeping it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, confirming, this is what I'm used to

sourceFile,
insertionSite.parent.expression,
createParen(createAwait(insertionSite.parent.expression)));
insertLeadingSemicolonIfNeeded(changeTracker, insertionSite.parent.expression, sourceFile);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
insertLeadingSemicolonIfNeeded(changeTracker, insertionSite.parent.expression, sourceFile);
insertLeadingSemicolonIfNeeded(changeTracker, insertionSite.parent.expression, sourceFile);

Copy link
Member Author

@andrewbranch andrewbranch Nov 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current indentation is correct (the preceding three lines are arguments to replaceNode; this is not)

@andrewbranch andrewbranch merged commit 571ca60 into microsoft:master Nov 19, 2019
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Await insert break ASI

5 participants