Skip to content

feat(parse/html/svelte): new svelte syntax for comments inside tags#9173

Merged
dyc3 merged 1 commit intomainfrom
dyc3/new-svelte-comments
Feb 25, 2026
Merged

feat(parse/html/svelte): new svelte syntax for comments inside tags#9173
dyc3 merged 1 commit intomainfrom
dyc3/new-svelte-comments

Conversation

@dyc3
Copy link
Contributor

@dyc3 dyc3 commented Feb 21, 2026

Summary

In sveltejs/svelte#17671, Svelte just added support for comments inside HTML tags. This PR updates our HTML parser to accept this syntax, and properly treat these comments as trivia.

Test Plan

snapshots

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 21, 2026

🦋 Changeset detected

Latest commit: cf6d75a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

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

@github-actions github-actions bot added A-Parser Area: parser L-HTML Language: HTML and super languages labels Feb 21, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 21, 2026

Merging this PR will improve performance by 13.13%

⚡ 2 improved benchmarks
✅ 62 untouched benchmarks
⏩ 152 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
synthetic/astro-expressions.astro[uncached] 1.2 ms 1.1 ms +11.42%
synthetic/astro-expressions.astro[cached] 1,053 µs 930.8 µs +13.13%

Comparing dyc3/new-svelte-comments (cf6d75a) with main (1d2ca15)2

Open in CodSpeed

Footnotes

  1. 152 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (6c296ea) during the generation of this report, so 1d2ca15 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@dyc3 dyc3 marked this pull request as ready for review February 21, 2026 15:45
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

Walkthrough

This PR adds Svelte-aware JS-style comment support inside tag attributes. Changes include a new lexing context InsideTagSvelte, JS comment consumers for // and /* ... */ (with unterminated-block diagnostics), a svelte flag on HtmlParseOptions plus .with_svelte(), and a new SingleTextExpressions syntax feature. Token-source, lexer, parser and formatter codepaths were updated to carry the Svelte context, and new unit/spec tests and test assets were added for valid and unterminated comment cases.

Possibly related PRs

Suggested reviewers

  • ematipico
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarises the main change: adding support for Svelte's new syntax allowing JS-style comments inside HTML tags.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation (Svelte's new feature), the solution (parser update), and the test approach (snapshots).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dyc3/new-svelte-comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)

484-495: ⚠️ Potential issue | 🟠 Major

Svelte comment support can break after {…} attributes.
parse_svelte_spread_or_expression re-lexes with InsideTag, so after a {…} attribute the lexer drops InsideTagSvelte and JS-style comments inside the tag won’t be tokenised. That undermines the new inside-tag comment support when a comment follows an expression. Consider preserving InsideTagSvelte when Svelte is enabled.

🛠️ Suggested fix (in `crates/biome_html_parser/src/syntax/svelte.rs`)
 pub(crate) fn parse_svelte_spread_or_expression(p: &mut HtmlParser) -> ParsedSyntax {
     if !SingleTextExpressions.is_supported(p) {
         return Absent;
     }
@@
-    if p.at(T![...]) {
+    let tag_ctx = if HtmlSyntaxFeatures::Svelte.is_supported(p) {
+        HtmlLexContext::InsideTagSvelte
+    } else {
+        HtmlLexContext::InsideTag
+    };
+
+    if p.at(T![...]) {
         p.bump_with_context(T![...], HtmlLexContext::single_expression());
@@
-        p.expect_with_context(T!['}'], HtmlLexContext::InsideTag);
+        p.expect_with_context(T!['}'], tag_ctx);
         Present(m.complete(p, HTML_SPREAD_ATTRIBUTE))
     } else {
         p.rewind(checkpoint);
         m.abandon(p);
-        parse_single_text_expression(p, HtmlLexContext::InsideTag)
+        parse_single_text_expression(p, tag_ctx)
     }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_parser/src/syntax/mod.rs` around lines 484 - 495, The
Svelte expression parser parse_svelte_spread_or_expression currently re-lexes
with InsideTag, which drops InsideTagSvelte and prevents JS-style comments
inside tags from being tokenized; update parse_svelte_spread_or_expression (or
add a variant) to preserve or restore the InsideTagSvelte lexer mode when
Svelte.is_supported is true so that comments after `{…}` attributes remain
tokenized; adjust Svelte.parse_exclusive_syntax call sites (and disabled_svelte
fallback) to use the preserving variant so the lexer state remains
InsideTagSvelte across the re-lexing boundary.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/biome_html_parser/src/syntax/mod.rs`:
- Around line 484-495: The Svelte expression parser
parse_svelte_spread_or_expression currently re-lexes with InsideTag, which drops
InsideTagSvelte and prevents JS-style comments inside tags from being tokenized;
update parse_svelte_spread_or_expression (or add a variant) to preserve or
restore the InsideTagSvelte lexer mode when Svelte.is_supported is true so that
comments after `{…}` attributes remain tokenized; adjust
Svelte.parse_exclusive_syntax call sites (and disabled_svelte fallback) to use
the preserving variant so the lexer state remains InsideTagSvelte across the
re-lexing boundary.

@dyc3 dyc3 force-pushed the dyc3/new-svelte-comments branch from e5b8705 to a9fe2c0 Compare February 21, 2026 16:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)

447-469: ⚠️ Potential issue | 🟡 Minor

Duplicate match arms for T!["{{"].

Lines 447-457 and 458-469 both match T!["{{"]. This appears to be a merge artefact — the first arm will always be taken, making the second unreachable.

🐛 Suggested fix: remove the duplicate arm
     match p.cur() {
         T!["{{"] => {
             let m = p.start();
             DoubleTextExpressions
                 .parse_exclusive_syntax(
                     p,
                     |p| parse_double_text_expression(p, HtmlLexContext::InsideTag),
                     |p, marker| disabled_interpolation(p, marker.range(p)),
                 )
                 .ok();
             Present(m.complete(p, HTML_ATTRIBUTE))
         }
-        T!["{{"] => {
-            let m = p.start();
-            HtmlSyntaxFeatures::DoubleTextExpressions
-                .parse_exclusive_syntax(
-                    p,
-                    |p| parse_double_text_expression(p, HtmlLexContext::InsideTag),
-                    |p, marker| disabled_interpolation(p, marker.range(p)),
-                )
-                .ok();
-
-            Present(m.complete(p, HTML_ATTRIBUTE))
-        }
         // Check for Astro directives before Vue colon shorthand
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_parser/src/syntax/mod.rs` around lines 447 - 469, There are
duplicate match arms for T!["{{"] — remove the redundant arm so only one
T!["{{"] branch remains; specifically delete the first arm that uses the bare
DoubleTextExpressions and keep the namespaced
HtmlSyntaxFeatures::DoubleTextExpressions variant (which calls
parse_double_text_expression and disabled_interpolation and completes with
Present(m.complete(p, HTML_ATTRIBUTE))) to avoid the unreachable duplicate and
preserve the intended feature check.
🧹 Nitpick comments (1)
crates/biome_html_parser/src/lexer/mod.rs (1)

1500-1503: Consider extracting is_linebreak to a shared location.

This function duplicates the one in crates/biome_js_parser/src/lexer/mod.rs (lines 2071-2073). If more parsers need JS-style comment handling, it might be worth extracting to a common utility crate.

Not blocking — just a thought for future maintenance.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_parser/src/lexer/mod.rs` around lines 1500 - 1503, The
is_linebreak function is duplicated; extract it into a shared utility (e.g., a
common crate or shared module) and replace the local implementations with a
single public function (is_linebreak) imported where needed; update calls in
biome_html_parser::lexer::is_linebreak and the other lexer that currently
duplicates it to use the shared utility, ensure the function signature and
visibility are appropriate (pub(crate) or pub) and run cargo check to confirm no
remaining duplicates or visibility errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@crates/biome_html_parser/src/syntax/mod.rs`:
- Around line 447-469: There are duplicate match arms for T!["{{"] — remove the
redundant arm so only one T!["{{"] branch remains; specifically delete the first
arm that uses the bare DoubleTextExpressions and keep the namespaced
HtmlSyntaxFeatures::DoubleTextExpressions variant (which calls
parse_double_text_expression and disabled_interpolation and completes with
Present(m.complete(p, HTML_ATTRIBUTE))) to avoid the unreachable duplicate and
preserve the intended feature check.

---

Nitpick comments:
In `@crates/biome_html_parser/src/lexer/mod.rs`:
- Around line 1500-1503: The is_linebreak function is duplicated; extract it
into a shared utility (e.g., a common crate or shared module) and replace the
local implementations with a single public function (is_linebreak) imported
where needed; update calls in biome_html_parser::lexer::is_linebreak and the
other lexer that currently duplicates it to use the shared utility, ensure the
function signature and visibility are appropriate (pub(crate) or pub) and run
cargo check to confirm no remaining duplicates or visibility errors.

@dyc3 dyc3 requested review from a team February 21, 2026 18:08
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Code-wise, it looks ok. I would add more few more tests as I highlighted in one of my commenets

@@ -0,0 +1,31 @@
<button
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if it's valid or not, I leave that to you, but we should add tests for inline comments

<div /*i am a comment*/  class=""></div>

If this is valid syntax, we must update formatting, and maybe collapse the attribute(s) on multiple lines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We actually don't completely know what the upstream formatting is going to look like because prettier-plugin-svelte hasn't implemented it yet. I'll add tests to make sure nothing terrible happens, but ultimately I'm going to wait for the upstream behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually nevermind, I was looking at the wrong branch. This PR implements it sveltejs/prettier-plugin-svelte#510

Copy link
Member

Choose a reason for hiding this comment

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

Yeah and as we can see they don't even take my example in consideration. There's no test for it. I suppose we'll have to do ourselves.

Copy link
Contributor Author

@dyc3 dyc3 Feb 24, 2026

Choose a reason for hiding this comment

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

Yeah I actually found a bug in their plugin while comparing the behavior, funnily enough. I've enhanced our tests, I believe it should cover everything

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/biome_html_parser/src/syntax/mod.rs (1)

490-497: ⚠️ Potential issue | 🟠 Major

Astro expressions incorrectly route through Svelte parser—reorder branches to prioritise Astro.

Both Astro and Svelte enable SingleTextExpressions, so line 490 matches Astro files first and routes them to parse_svelte_spread_or_expression instead of parse_astro_spread_or_expression. This causes Astro {...} syntax to be parsed with Svelte semantics and can mis-tokenise subsequent directives via the Svelte lex context.

Suggested fix
-        T!['{'] if SingleTextExpressions.is_supported(p) => parse_svelte_spread_or_expression(p),
-        T!['{'] if Astro.is_supported(p) => parse_astro_spread_or_expression(p),
+        T!['{'] if Astro.is_supported(p) => parse_astro_spread_or_expression(p),
+        T!['{'] if SingleTextExpressions.is_supported(p) => parse_svelte_spread_or_expression(p),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_parser/src/syntax/mod.rs` around lines 490 - 497, Astro
expressions are being routed to the Svelte parser because the branch checking
SingleTextExpressions precedes the Astro check; swap the branch order so the
T!['{'] if Astro.is_supported(p) arm comes before the T!['{'] if
SingleTextExpressions.is_supported(p) arm and still retain the fallback T!['{']
=> Svelte.parse_exclusive_syntax(...) behavior with the disabled_svelte
fallback. Update the match so parse_astro_spread_or_expression is called when
Astro.is_supported(p) is true, parse_svelte_spread_or_expression is called when
SingleTextExpressions.is_supported(p) is true, and the final T!['{'] fallback
remains unchanged.
🧹 Nitpick comments (4)
crates/biome_html_formatter/src/verbatim.rs (1)

276-285: Consider preserving extra blank lines after // comments.

Line 281-285 collapses any lines_after > 0 into a single hard break, so lines_after >= 2 loses a blank line. If that’s unintentional, map lines_after == 1 to hard_line_break() and >= 2 to empty_line().

🔧 Possible tweak
                 match comment.lines_after() {
                     0 => {}
-                    _ => {
-                        biome_formatter::write!(f, [hard_line_break()])?;
-                    }
+                    1 => biome_formatter::write!(f, [hard_line_break()])?,
+                    _ => biome_formatter::write!(f, [empty_line()])?,
                 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_formatter/src/verbatim.rs` around lines 276 - 285, The
current CommentKind::Line handling collapses any comment.lines_after() > 0 into
a single hard_line_break(), losing extra blank lines; change the match on
comment.lines_after() so that 0 => no output, 1 => emit a hard_line_break(), and
_ (>=2) => emit an empty_line() (via biome_formatter::write!(f,
[empty_line()])?) instead of hard_line_break() so multiple blank lines are
preserved; update the branch that calls biome_formatter::write!(f,
[hard_line_break()]) accordingly.
crates/biome_html_parser/src/parser.rs (1)

156-159: with_svelte() is missing an inline doc comment.

with_frontmatter() doesn't have one either, but it'd be good to be consistent with the codebase style here.

✏️ Suggested addition
+    /// Enables Svelte-specific parsing (JS-style `//` and `/* */` comments inside tags).
     pub fn with_svelte(mut self) -> Self {
         self.svelte = true;
         self
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_parser/src/parser.rs` around lines 156 - 159, The method
with_svelte() is missing an inline Rust doc comment; add a short /// doc comment
above pub fn with_svelte(mut self) -> Self that explains what enabling Svelte
parsing does (e.g., "Enable Svelte-specific parsing behavior" or similar),
mentions that it sets the svelte flag and returns Self for chaining, and mirror
the same style for with_frontmatter() so both builder methods have consistent
inline docs; reference the functions by name (with_svelte and with_frontmatter)
when adding the comments.
crates/biome_html_parser/src/lexer/mod.rs (2)

1512-1515: is_linebreak is a local copy of an identical helper in biome_js_parser.

Not a bug — just a nudge to consider extracting it to a shared utility crate if/when this grows. For now it's fine where it is.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_parser/src/lexer/mod.rs` around lines 1512 - 1515, The
is_linebreak function in this module duplicates an identical helper in
biome_js_parser; to avoid drift, extract the logic into a shared utility (e.g.,
a common crate or module) and replace this local fn is_linebreak with a call to
that shared helper (or add a clear TODO pointing to the shared helper) so both
lexer/mod.rs and biome_js_parser reference the same implementation (identify the
function by name is_linebreak to locate and update usages).

591-610: Simplify the catch-all arms in consume_js_block_comment.

The explicit IDT | ZER | DIG | WHS | COL | SLH | MIN | MUL => self.advance(1) arm is fully subsumed by the generic _ if chr.is_ascii() => self.advance(1) arm below it — every listed dispatch category is ASCII. The only arm that must be explicit is the MUL if … terminator guard. Collapsing the rest reduces noise.

♻️ Proposed simplification
     fn consume_js_block_comment(&mut self) -> HtmlSyntaxKind {
         self.advance(2);
         while let Some(chr) = self.current_byte() {
             let dispatched = lookup_byte(chr);
             match dispatched {
                 MUL if self.byte_at(1).map(lookup_byte) == Some(SLH) => {
                     self.advance(2);
                     return COMMENT;
                 }
-                IDT | ZER | DIG | WHS | COL | SLH | MIN | MUL => self.advance(1),
                 _ if chr.is_ascii() => self.advance(1),
                 _ => self.advance(self.current_char_unchecked().len_utf8()),
             }
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@crates/biome_html_parser/src/lexer/mod.rs` around lines 591 - 610, In
consume_js_block_comment, remove the redundant match arm listing IDT | ZER | DIG
| WHS | COL | SLH | MIN | MUL and rely on the existing `_ if chr.is_ascii() =>
self.advance(1)` catch-all, keeping the special `MUL if
self.byte_at(1).map(lookup_byte) == Some(SLH) => { self.advance(2); return
COMMENT; }` branch and the unicode fallback that advances by
`current_char_unchecked().len_utf8()`. This simplifies the match while
preserving behavior of lookup_byte, current_byte, byte_at, advance, and the
diagnostic push via push_diagnostic/ParseDiagnostic and the returned COMMENT
kind.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/prettier-compare/package.json`:
- Line 17: The package.json currently references a non-existent dependency
version for "prettier-plugin-svelte"; update the dependency entry for
prettier-plugin-svelte in package.json (the "prettier-plugin-svelte" key) to a
published version such as "^3.4.0" or change it to a range/placeholder that will
be released (or add a comment/PR note if you intend to publish 3.5.0 before
merge) so CI/npm install won’t fail.
- Line 17: The package.json dependency "prettier-plugin-svelte" pins a
non-existent version (^3.5.0) which will break installs; update the dependency
value in packages/prettier-compare's package.json to a published version (e.g.,
^3.4.1) or add a note in the repo docs/README that the workspace requires the
upstream 3.5.0 release before installing, and ensure any CI/package-lock updates
reflect this change; look for the "prettier-plugin-svelte" entry in package.json
to make the edit.

---

Outside diff comments:
In `@crates/biome_html_parser/src/syntax/mod.rs`:
- Around line 490-497: Astro expressions are being routed to the Svelte parser
because the branch checking SingleTextExpressions precedes the Astro check; swap
the branch order so the T!['{'] if Astro.is_supported(p) arm comes before the
T!['{'] if SingleTextExpressions.is_supported(p) arm and still retain the
fallback T!['{'] => Svelte.parse_exclusive_syntax(...) behavior with the
disabled_svelte fallback. Update the match so parse_astro_spread_or_expression
is called when Astro.is_supported(p) is true, parse_svelte_spread_or_expression
is called when SingleTextExpressions.is_supported(p) is true, and the final
T!['{'] fallback remains unchanged.

---

Nitpick comments:
In `@crates/biome_html_formatter/src/verbatim.rs`:
- Around line 276-285: The current CommentKind::Line handling collapses any
comment.lines_after() > 0 into a single hard_line_break(), losing extra blank
lines; change the match on comment.lines_after() so that 0 => no output, 1 =>
emit a hard_line_break(), and _ (>=2) => emit an empty_line() (via
biome_formatter::write!(f, [empty_line()])?) instead of hard_line_break() so
multiple blank lines are preserved; update the branch that calls
biome_formatter::write!(f, [hard_line_break()]) accordingly.

In `@crates/biome_html_parser/src/lexer/mod.rs`:
- Around line 1512-1515: The is_linebreak function in this module duplicates an
identical helper in biome_js_parser; to avoid drift, extract the logic into a
shared utility (e.g., a common crate or module) and replace this local fn
is_linebreak with a call to that shared helper (or add a clear TODO pointing to
the shared helper) so both lexer/mod.rs and biome_js_parser reference the same
implementation (identify the function by name is_linebreak to locate and update
usages).
- Around line 591-610: In consume_js_block_comment, remove the redundant match
arm listing IDT | ZER | DIG | WHS | COL | SLH | MIN | MUL and rely on the
existing `_ if chr.is_ascii() => self.advance(1)` catch-all, keeping the special
`MUL if self.byte_at(1).map(lookup_byte) == Some(SLH) => { self.advance(2);
return COMMENT; }` branch and the unicode fallback that advances by
`current_char_unchecked().len_utf8()`. This simplifies the match while
preserving behavior of lookup_byte, current_byte, byte_at, advance, and the
diagnostic push via push_diagnostic/ParseDiagnostic and the returned COMMENT
kind.

In `@crates/biome_html_parser/src/parser.rs`:
- Around line 156-159: The method with_svelte() is missing an inline Rust doc
comment; add a short /// doc comment above pub fn with_svelte(mut self) -> Self
that explains what enabling Svelte parsing does (e.g., "Enable Svelte-specific
parsing behavior" or similar), mentions that it sets the svelte flag and returns
Self for chaining, and mirror the same style for with_frontmatter() so both
builder methods have consistent inline docs; reference the functions by name
(with_svelte and with_frontmatter) when adding the comments.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9fe2c0 and db5920f.

⛔ Files ignored due to path filters (6)
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-component-tags.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-tags.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/unterminated_js_multiline_comment.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_component_tags.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_tag.svelte.snap is excluded by !**/*.snap and included by **
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by **
📒 Files selected for processing (16)
  • .changeset/chatty-jeans-shine.md
  • crates/biome_html_formatter/src/comments.rs
  • crates/biome_html_formatter/src/verbatim.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-component-tags.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-tags.svelte
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/src/parser.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/src/syntax/vue.rs
  • crates/biome_html_parser/src/token_source.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/unterminated_js_multiline_comment.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_component_tags.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_tag.svelte
  • packages/prettier-compare/package.json
✅ Files skipped from review due to trivial changes (1)
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-tags.svelte
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/biome_html_parser/src/lexer/tests.rs
  • .changeset/chatty-jeans-shine.md
  • crates/biome_html_parser/src/syntax/svelte.rs

@dyc3 dyc3 force-pushed the dyc3/new-svelte-comments branch from db5920f to cf6d75a Compare February 24, 2026 21:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
packages/prettier-compare/package.json (1)

17-17: Please confirm prettier-plugin-svelte 3.5.0 is actually published.
If it isn’t on npm yet, installs will fail; consider pinning to the latest published version until the release lands.

#!/bin/bash
python - <<'PY'
import json, urllib.request
data = json.load(urllib.request.urlopen("https://registry.npmjs.org/prettier-plugin-svelte"))
print("latest:", data["dist-tags"]["latest"])
print("has 3.5.0:", "3.5.0" in data.get("versions", {}))
PY
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/prettier-compare/package.json` at line 17, Check whether the
dependency entry "prettier-plugin-svelte": "^3.5.0" in package.json points to a
published npm release; if 3.5.0 is not published, change the package.json
dependency to a published version (e.g., pin to the current dist-tag/latest
version) or use a valid semver that resolves to an existing version, and update
any lockfile (npm install / yarn install) to regenerate lock entries; reference
the dependency string "prettier-plugin-svelte" in package.json when making the
change and run the provided npm/registry check to verify the new version exists.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/prettier-compare/package.json`:
- Line 17: Check whether the dependency entry "prettier-plugin-svelte": "^3.5.0"
in package.json points to a published npm release; if 3.5.0 is not published,
change the package.json dependency to a published version (e.g., pin to the
current dist-tag/latest version) or use a valid semver that resolves to an
existing version, and update any lockfile (npm install / yarn install) to
regenerate lock entries; reference the dependency string
"prettier-plugin-svelte" in package.json when making the change and run the
provided npm/registry check to verify the new version exists.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between db5920f and cf6d75a.

⛔ Files ignored due to path filters (6)
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-component-tags.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-tags.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/error/svelte/unterminated_js_multiline_comment.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_component_tags.svelte.snap is excluded by !**/*.snap and included by **
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_tag.svelte.snap is excluded by !**/*.snap and included by **
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml and included by **
📒 Files selected for processing (16)
  • .changeset/chatty-jeans-shine.md
  • crates/biome_html_formatter/src/comments.rs
  • crates/biome_html_formatter/src/verbatim.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-component-tags.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-tags.svelte
  • crates/biome_html_parser/src/lexer/mod.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_parser/src/parser.rs
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/syntax/svelte.rs
  • crates/biome_html_parser/src/syntax/vue.rs
  • crates/biome_html_parser/src/token_source.rs
  • crates/biome_html_parser/tests/html_specs/error/svelte/unterminated_js_multiline_comment.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_component_tags.svelte
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_tag.svelte
  • packages/prettier-compare/package.json
🚧 Files skipped from review as they are similar to previous changes (7)
  • .changeset/chatty-jeans-shine.md
  • crates/biome_html_parser/tests/html_specs/ok/svelte/js_comments_in_tag.svelte
  • crates/biome_html_parser/src/syntax/mod.rs
  • crates/biome_html_parser/src/parser.rs
  • crates/biome_html_parser/src/lexer/tests.rs
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-component-tags.svelte
  • crates/biome_html_formatter/tests/specs/html/svelte/comments-in-tags.svelte

@dyc3 dyc3 merged commit 32dad2d into main Feb 25, 2026
18 checks passed
@dyc3 dyc3 deleted the dyc3/new-svelte-comments branch February 25, 2026 15:52
@github-actions github-actions bot mentioned this pull request Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Parser Area: parser L-HTML Language: HTML and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants