Last 12 weeks · 0 commits
2 of 6 standards met
When given: The formatted output becomes: Here's a reproduction: https://deploy-preview-4010--biomejs.netlify.app/playground/?code=PABkAGkAdgAgAGMAbABhAHMAcwA9ACIAZgBvAG8AIgAvACoAIABiAGwAbwBjAGsAIABjAG8AbQBtAGUAbgB0ACAAKgAvAD4AdABlAHgAdAA8AC8AZABpAHYAPgA%3D&language=svelte Biome's playground uses so it can compare formatting behavior with svelte. Support for the syntax hasn't been merged into Biome yet, so that's why the biome output is blank.
Repository: sveltejs/prettier-plugin-svelte. Description: Format your svelte components using prettier. Stars: 807, Forks: 98. Primary language: TypeScript. Languages: TypeScript (64.6%), HTML (34.4%), JavaScript (0.9%). License: MIT. Open PRs: 7, open issues: 57. Last activity: 1w ago. Community health: 50%. Top contributors: dummdidumm, jamesbirtles, Conduitry, dependabot[bot], jarrodldavis, ehrencrona, jrmajor, clebert, orlov-vo, clitetailor and others.
When writing Typescript code in the "HTML" (or "body") part of a Svelte component, I came across a formatting issue that broke the syntax of the code. The code in question follows below. I duplicated the line in the script tag and the "body" part to show that the two parts behave differently. The first code block is before formatting; the second is after formatting. Before formatting: After formatting: As you can see in the "body" part of the component, became seriously modified with spaces and line breaks where there shouldn't be and syntax highlighting being lost (in VS Code). Furthermore, the formatting operation removed some parentheses (initially surrounding ), thus breaking the code syntax. The `.tsElement` tag is correctly formatted.
The formatter seems not to be working with monorepo! I have three mono repo in a project (i.e. , , and ), the dir is a Next.js app, while the dir contains multiple servers which are Nest.js apps, and finally, the dir is a Svelte (SvelteKit) app. If the working directory is the root/project folder prettier works perfectly on the and dir, and other files in the dir except for the files but the formatter works with files if the working directory is itself. And my PC lag if I have multiple vscode instances running with other heavy applications (i.e. Docker, Firefox, Postman, etc) What am I doing wrong!? System info: OS: Ubuntu 22.04 CPUs: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (4 x 2500) GPU Status: 2d_canvas: unavailable_software canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: disabled_software multiple_raster_threads: enabled_on opengl: disabled_off rasterization: disabled_software raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: disabled_software video_encode: disabled_software vulkan: disabled_off webgl: unavailable_software webgl2: unavailable_software webgpu: disabled_off Load (avg): 1, 0, 0 Memory (System): 7.65GB (2.55GB free) Process Argv: --no-sandbox . --crash-reporter-id 93055eb6-6fd7-4a64-90ee-21296107114f Screen Reader: no VM: 0%
I still have this problem, with for example this kind of code: it's replaced for: tried even comment above {@html ...}, but still it was transforming it to that ugly prettier:content thing. https://www.youtube.com/watch?v=lHK66Y06OoE @dummdidumm _Originally posted by @Mlocik97 in https://github.com/sveltejs/prettier-plugin-svelte/issues/59#issuecomment-890403216_
This plugin does not preserve whitespace when using with another element inside of it, causing the formatter to meaningfully change the HTML output and styling of that output displayed in the browser, e.g. When passing this to prettier with this plugin a file, the result is that you get: Which is meaningfully not the same AFAIK