Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/flat-rockets-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
---

Biome now keeps a blank line after the frontmatter section in Astro files.
3 changes: 3 additions & 0 deletions crates/biome_cli/tests/cases/handle_astro_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ let schema = z.object().optional();
schema + sure()
---




<html><head><title>Astro</title></head><body></body></html>

<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (bar > 1) {
console.log(bar + 1);
}
---

<Foo>{bar}</Foo>

<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ expression: redactor(content)
---
const title = "My Page";
---

<html>
<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import z from "zod";
const schema = z.object().optional();
schema + sure();
---

<html>
<head>
<title>Astro</title>
Expand Down Expand Up @@ -56,15 +57,15 @@ check ━━━━━━━━━━━━━━━━━━━━━━━━
# Emitted Messages

```block
file.astro:13:20 lint/a11y/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
file.astro:16:20 lint/a11y/useGenericFontNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

× Generic font family missing.

12 │ <style>
> 13 │ #id { font-family: comic-sans } .class { background: red}
15 │ <style>
> 16 │ #id { font-family: comic-sans } .class { background: red}
│ ^^^^^^^^^^
14 │ </style>
15
17 │ </style>
18

i Consider adding a generic font family as a fallback.

Expand Down
2 changes: 1 addition & 1 deletion crates/biome_html_formatter/src/html/auxiliary/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl FormatNodeRule<HtmlRoot> for FormatHtmlRoot {
}

if let Some(frontmatter) = frontmatter {
write!(f, [frontmatter.format(), hard_line_break()])?;
write!(f, [frontmatter.format(), empty_line()])?;
}

if let Some(directive) = directive {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Self close void elements: never
import Button from './Button.astro';
import TextInput from './TextInput.astro';
---

<Button label="test button"/>
<TextInput placeholder="enter text"/>
<button>native button</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ Self close void elements: never
---
layout: foo
---

Test <a href="https://prettier.io">abc</a>.
```

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading