prettier-plugin-astro
: support different formatting options for different parts of .astro
files
#1194
romanstetsyk
started this conversation in
Proposal
Replies: 0 comments
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.
-
Body
Summary
Allow
prettier-plugin-astro
to support separate formatting configurations for different parts of.astro
files, such as front-matter,<script>
tags, and the HTML/CSS template.Background & Motivation
Currently,
prettier-plugin-astro
applies a single Prettier configuration to the entire.astro
file with the option to skip the front-matter. This can be limiting because.astro
files often contain multiple languages (e.g., TypeScript in front-matter, JavaScript in<script>
, HTML in the template, and CSS in<style>
tags). Users who prefer different formatting rules per language context (e.g., wider line width for markup, narrower for scripts) cannot achieve this within a single.astro
file.For example, users may prefer:
Goals
Support different Prettier formatting settings for:
<script>
tagsBeta Was this translation helpful? Give feedback.
All reactions