From ae21d03a52212892027e152ab492d2e341ff1d25 Mon Sep 17 00:00:00 2001 From: Dillon Mulroy Date: Tue, 4 Jun 2024 14:41:58 -0400 Subject: [PATCH] docs: Update svelte 5 preview faqs to include lsp formatting (#11906) * update svelte 5 preview faqs to include lsp formatting * prettier * typo * tweak wording * use `/// file:` pragma --------- Co-authored-by: Rich Harris --- .../routes/docs/content/03-appendix/01-faq.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sites/svelte-5-preview/src/routes/docs/content/03-appendix/01-faq.md b/sites/svelte-5-preview/src/routes/docs/content/03-appendix/01-faq.md index 49239beb9..ef11115a8 100644 --- a/sites/svelte-5-preview/src/routes/docs/content/03-appendix/01-faq.md +++ b/sites/svelte-5-preview/src/routes/docs/content/03-appendix/01-faq.md @@ -91,6 +91,27 @@ All other features, including stores, are still fully supported in runes mode. `beforeUpdate` and `afterUpdate` are deprecated — use `$effect.pre` and `$effect` instead, as these are more conservative about when they run code. Everything else will remain. +### Prettier formatting is broken, what gives? + +`svelte-lsp` ships with a stable version of Svelte to support the largest number of people out of the box. To make the language server compatible with Svelte 5 you will need to install the latest versions of `prettier` and `prettier-plugin-svelte` in your project and create (or update) a `.prettierrc` file: + +```sh +npm i --save-dev prettier-plugin-svelte prettier +``` + +```json +/// file: .prettierrc +{ + "plugins": ["prettier-plugin-svelte"], + "overrides": [ + { + "files": "*.svelte", + "options": { "parser": "svelte" } + } + ] +} +``` + ## Schedule and future plans ### When is it coming out?