Skip to content

fix: keep a comment on the lines before an argument on its own lines - #924

Merged
dsherret merged 1 commit into
mainfrom
fix-block-comment-before-argument
Nov 13, 2026
Merged

dsherret merged 1 commit into
mainfrom
fix-block-comment-before-argument

Conversation

@dsherret

@dsherret dsherret commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Closes #919

Stacked on #923.

A comment on its own lines before a value that's allowed to span multiple lines beside the other values (a function, arrow function, object, array, etc.) didn't cause the list to break, so the comment ended up at the end of the previous value's line:

addPropertyListener(windowObj, "onerror", /**
 * @returns the callback
 */
function() {
  return cb;
});

A value with a comment like that is now treated as being multi-line and not allowed to be inline, so the values go on separate lines (or stay hanging with preferHanging) and the comment stays above its value. A block comment that's beside its value (ex. call(a, /* comment */ () => {})) doesn't change anything.

@dsherret
dsherret added this pull request to stack #927 November 13, 2026 22:38
@dsherret
dsherret force-pushed the fix-block-comment-before-argument branch from 28e137f to f7daa3d Compare November 13, 2026 22:41
Base automatically changed from fix-for-of-hug-array to main November 13, 2026 22:45
@dsherret
dsherret force-pushed the fix-block-comment-before-argument branch from f7daa3d to 4e46a70 Compare November 13, 2026 22:45
@dsherret
dsherret merged commit 920d117 into main Nov 13, 2026
1 check 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.

Block comment before a call argument is moved to the end of the previous argument's line

1 participant