diff --git a/.changeset/grumpy-ears-chew.md b/.changeset/grumpy-ears-chew.md new file mode 100644 index 0000000..1d7f201 --- /dev/null +++ b/.changeset/grumpy-ears-chew.md @@ -0,0 +1,5 @@ +--- +"prettier-plugin-astro": patch +--- + +Format doctype as lowercase to match Prettier 3.0 diff --git a/src/printer/index.ts b/src/printer/index.ts index 74538ba..0935c78 100644 --- a/src/printer/index.ts +++ b/src/printer/index.ts @@ -319,7 +319,7 @@ export function print(path: AstPath, opts: ParserOptions, print: printFn): Doc { case 'doctype': { // https://www.w3.org/wiki/Doctypes_and_markup_styles - return ['', hardline]; + return ['', hardline]; } case 'comment': diff --git a/test/fixtures/basic/basic-html/output.astro b/test/fixtures/basic/basic-html/output.astro index c77d273..3cfe94a 100644 --- a/test/fixtures/basic/basic-html/output.astro +++ b/test/fixtures/basic/basic-html/output.astro @@ -1,4 +1,4 @@ - + diff --git a/test/fixtures/other/doctype-with-embedded-expr/output.astro b/test/fixtures/other/doctype-with-embedded-expr/output.astro index 0d47aa2..6208244 100644 --- a/test/fixtures/other/doctype-with-embedded-expr/output.astro +++ b/test/fixtures/other/doctype-with-embedded-expr/output.astro @@ -6,7 +6,7 @@ let title = "My Site"; const colors = ["red", "yellow", "blue"]; --- - + My site diff --git a/test/fixtures/other/doctype-with-extra-attributes/output.astro b/test/fixtures/other/doctype-with-extra-attributes/output.astro index 76e9d89..4c5fd5d 100644 --- a/test/fixtures/other/doctype-with-extra-attributes/output.astro +++ b/test/fixtures/other/doctype-with-extra-attributes/output.astro @@ -6,7 +6,7 @@ let title = "My Site"; const colors = ["red", "yellow", "blue"]; --- - + My site diff --git a/test/fixtures/other/fragment/output.astro b/test/fixtures/other/fragment/output.astro index 604781e..eaa859a 100644 --- a/test/fixtures/other/fragment/output.astro +++ b/test/fixtures/other/fragment/output.astro @@ -1,4 +1,4 @@ - +