feat: report comments that stand alone in an open tag - #248
Merged
DylanPiercey merged 1 commit intoSep 23, 2026
Merged
Conversation
`OPEN_TAG.return` ignored every child but an expression, so a `//` or `/* */` comment that did not follow a value was consumed without an event, and consumers dropped it. It is now reported through a new `onOpenTagComment` handler, separate from `onComment` so that consumers which add every comment to the current body are unaffected until they handle it. A comment that follows a value is still part of it, like a comment anywhere else inside JavaScript code. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 6c3597f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #248 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 35 35
Lines 4604 4611 +7
Branches 882 888 +6
=======================================
+ Hits 4602 4609 +7
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
DylanPiercey
deleted the
dpiercey-ws-prettier-marko-async-ulp3vg-open-tag-comments
branch
September 23, 2026 18:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
//or/* */comment that stood alone in an open tag, eg<div /* c */ class="box">or a// whyline between attributes, was consumed without any event, so consumers such as prettier-plugin-marko dropped it. It is now reported through a newonOpenTagCommenthandler. A comment that follows a value is still part of that value, like any comment inside JavaScript code.It is a separate handler from
onCommentbecause existing consumers add everyonCommentto the current body, which would move these comments into the tag's body (and give a void tag like<input>a body); with a new handler they see no change until they opt in. The content states and the open tag now share one helper for a JS comment's range.🤖 Generated with Claude Code