From 9426e65c7a7256ef23cb4d9a37ca7e28c1d7e2b9 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 6 Oct 2024 12:52:52 -0700 Subject: [PATCH] chore(playground): upgrade prettier to v3 --- playground/bun.lockb | Bin 55348 -> 52803 bytes playground/package.json | 2 +- playground/src/TabMarkdown.svelte | 21 +++++++++++++++------ playground/src/TabTypeScript.svelte | 23 +++++++++++++---------- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/playground/bun.lockb b/playground/bun.lockb index 6e53cb23773d88fac95ba64401b0e8983404e423..200e4c74585c81da0c4f494d8e2a474eac51a0e3 100755 GIT binary patch delta 8771 zcmeHNdt6mjzTbOuKn_ZRyv{xc1Wi%IkT()_z(N!bPahpYQ4w%N2n8Q$I)XMCMoz-d zOb8V;e2kN+lv-+Pc1=w!oGitXEcN1I~ z)>^-{)^D%F@~zDd`x_jVgao}<|H$TjI}e7O5pxb}U#Zsw*NXWnfn zi)%S5DCLD3tG{&R`I=dME3!mEa215gA;2!crFo@OiV6gwaN2|!MI{A-K_>{^Aa?}z z0RG-V5Ilj~fm!~Mjo$&x`n5KBtxY}`*cKOUIdmrp4vnK4xmc61R0Keh+<1+K916MZEYL;e)bhgV(<_P!%TuA?&_@CrfS*Ntd4^M`Oq-rRZJMAhjmDQk&kl~lh&#vw z&mEvsrTqnjOAr18usbls%7CWLEG(H`CawWWAz?R$#qb={2@5m8=2ZNZ953TKofvh6-C$8{@3n&mXmZQ7!tci(F6 zHFr$jvBTe{I?t!QPNB7(8r_m>-adV%^|`BkbwzGN^tWcU1UNd2^ojF9sZ1cFzgav< zr}Xin8_6#5;#kT?-AHvV@zQ0H+FZ+lN>$pfy(hZ{DqWF1)=AS=fwFl4rS|6Stoh3UrOH-=QvF>6 zrM8H~p-55u%>$*{9RQ`;bwfZ^Sq>;=eBv7COf2%>MS`n#D z9YGE#E4L80P_|dR^ldk4^D>JGBzwo}Yms9HVuLu)S$&NAVQ^+}h`TTd;7(ckK9t#0 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~%v9dRGtQ41@tykcbEFp%GjWvxMQ%0FiU1YTaDo-|WoZC)+7RG$9&z39MuF;zoJ4uIK)W~OS;t_%Ymb&l1%4a-tdDQwT#0Kt zrELtwE-xn=J7!$Re{|TIwS1Ywn3Obc<~6;(x%)$x%&MI1?BuK|_>0h|tqKQ@i+E;* z%?MmlFsDoBv*I+{I-l)wbD`{Ws@&L$ZY;781)5RmY#*AFn~|LDJvKclc~VMNR(ckt zAJS2iazCvs7@L)nK|RWYG`>C+lgne8HBkmu1|xB^UjITZ$J^7pzT%1f7`YvBqZ<{o ztUcAYIWIcC$%W?bcd(FmU{t-QB^}-GDt3{n^h1rPdAU6`Kj033Oz?b93GfdgYAIGfgokIV+74 zcRRO`HN3gX76W { console.log(error); }); - $: code = prettier.format(markdown, { - parser: "markdown", - plugins: [plugin], - }); + $: { + format(markdown, { + parser: "markdown", + plugins: [pluginMarkdown], + }) + .then((formatted) => { + code = formatted; + }) + .catch((error) => { + console.log(error); + }); + } diff --git a/playground/src/TabTypeScript.svelte b/playground/src/TabTypeScript.svelte index 246e9cf..848bc3f 100644 --- a/playground/src/TabTypeScript.svelte +++ b/playground/src/TabTypeScript.svelte @@ -2,8 +2,9 @@ export let parsed_component = {}; export let moduleName = ""; - import plugin from "prettier/parser-typescript"; - import prettier from "prettier/standalone"; + import pluginTypeScript from "prettier/plugins/typescript"; + import pluginEstree from "prettier/plugins/estree"; + import { format } from "prettier/standalone"; import { writeTsDefinition } from "../../src/writer/writer-ts-definitions"; import CodeHighlighter from "./CodeHighlighter.svelte"; import TabContentOverlay from "./TabContentOverlay.svelte"; @@ -15,15 +16,17 @@ moduleName, }); $: { - try { - prettier_error = null; - code = prettier.format(code, { - parser: "typescript", - plugins: [plugin], + prettier_error = null; + format(code, { + parser: "typescript", + plugins: [pluginTypeScript, pluginEstree], + }) + .then((formatted) => { + code = formatted; + }) + .catch((error) => { + prettier_error = error; }); - } catch (error) { - prettier_error = error; - } }