Avoid adding unnecessary indent to nested await by thorn0 · Pull Request #14192 · prettier/prettier (original) (raw)

Choose a reason for hiding this comment

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

Are we checking node is the head of AwaitExpression.argument here?

This function seems not always checking the leftmost node, it skips on some nodes.

Choose a reason for hiding this comment

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

This code is trying to avoid printing await (await on one line. Can you find a counterexample where it fails?

Choose a reason for hiding this comment

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

No. Just a question, the result looks good to me.

Choose a reason for hiding this comment

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

Even if it fails in some case, it won't break anything, just won't add forced indentation.