From 46b4342323327e79e69f508167a62a4d87eb0219 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:32:29 +0530 Subject: [PATCH] chore: use newline escape instead of trimStart --- scripts/patch.ts | 4 ++-- tests/index.test.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/patch.ts b/scripts/patch.ts index 19d8601..39bb279 100644 --- a/scripts/patch.ts +++ b/scripts/patch.ts @@ -24,7 +24,7 @@ await ensureDir('vendor') await Deno.writeTextFile('./vendor/prettier-plugin-markdown.js', transformed) await Deno.writeTextFile( './vendor/prettier-plugin-markdown.d.ts', - ` + `\ import type { Parser, Plugin, Printer } from 'prettier' declare const md: Plugin & { @@ -33,5 +33,5 @@ declare const md: Plugin & { } export default md -`.trimStart(), +`, ) diff --git a/tests/index.test.ts b/tests/index.test.ts index 0fa9546..c7d63e8 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -4,7 +4,7 @@ import { assertEquals } from '@std/assert' Deno.test('plugin', async (t) => { await t.step('should format vue in markdown', async () => { - const code = ` + const code = `\ --- yaml: frontmatter --- @@ -86,7 +86,7 @@ attrs {target="_self" #id} attrs {target="_self"} ` - const expected = ` + const expected = `\ --- yaml: frontmatter --- @@ -190,7 +190,7 @@ comment attrs {target="_self" #id} attrs {target="_self"} -`.trimStart() +` const result = await prettier.format(code, { parser: 'markdown',