Skip to content

Conversation

@a-tarasyuk
Copy link
Contributor

Fixes #2164


This PR adds the missing support for initializer trailing comments

// This is to ensure that we emit comment in the following case:
//      For example:
//          obj = {
//              id: /*comment1*/ ()=>void
//          }
// "comment1" is not considered to be leading comment for node.initializer
// but rather a trailing comment on the previous node.
const initializer = node.initializer;
if ((getEmitFlags(initializer) & EmitFlags.NoLeadingComments) === 0) {
    const commentRange = getCommentRange(initializer);
    emitTrailingCommentsOfPosition(commentRange.pos);
}

@jakebailey jakebailey added this pull request to the merge queue Nov 28, 2025
Merged via the queue into microsoft:main with commit ea6a3dc Nov 28, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pure annotation is dropped on property values

2 participants