Skip to content

Formatting inconsistent in .astro #142

@OliverSpeir

Description

@OliverSpeir

Depending on whether the <script> is inside a <Component/> it is formatted differently.

---

---

<html lang="en">
  <head>
    <meta charset="utf-8" />
  </head>
  <body>
    <h1>Astro</h1>
    <script>
    console.log("1");
      console.log("2");
    </script>
  </body>
</html>
---
import Component from "../Component.astro";
---

<Component>
  <h1>Astro</h1>
  <script>
  console.log("1");
  console.log("2");
  </script>
</Component>
// dprint.json
{
  "typescript": {},
  "markup": {},
  "excludes": ["**/node_modules"],
  "plugins": [
    "https://plugins.dprint.dev/typescript-0.95.9.wasm",
    "https://plugins.dprint.dev/g-plane/markup_fmt-v0.23.1.wasm"
  ]
}

Repro:
https://github.com/OliverSpeir/markup-fmt-astro-scriptindent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions