Replies: 1 comment 3 replies
-
|
I don't hold particular attachments to the configuration for the Astro front matter, so feel free to send a PR as a bug fix. The prettier plugin doesn't indent too, so a bug fix sounds reasonable
Can you provide a code example? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First of all, huge thanks to the developers for your hard work making support for Astro and other HTML-like files possible!
I noticed that when
indentScriptAndStyleis enabled, the frontmatter section in Astro files also gets indented. After reading the update blog, I understand this is likely intentional. However, I think it might be worth reconsidering whether this section should be indented.The frontmatter is typically used to hold static code, such as imports, variable declarations, and utility functions. Meanwhile, in the HTML-like section below, we have the
<script>element to contain functions that handle the actual page logic.Indenting this section feels like indenting the first few lines of a JavaScript or Rust file — which looks quite odd.
I’d like to kindly ask the developers to reconsider whether this indentation is truly necessary.
By the way, could we also keep a blank line after the frontmatter section? It looks cleaner that way and is more in line with common formatting conventions.
Beta Was this translation helpful? Give feedback.
All reactions