Very slow formatting with Prettier #8693
Replies: 5 comments 3 replies
-
I tried configuring prettier as a formatter and through Also would be nice to have the range formatting support #3209. |
Beta Was this translation helpful? Give feedback.
-
Maybe try https://github.com/fsouza/prettierd instead |
Beta Was this translation helpful? Give feedback.
-
Try Deno, it has a Rust clone of Prettier called dprint built in that is infinitely faster:
Or just use dprint itself, but that seems more complex to setup: https://dprint.dev/install/, it even has a wrapper for Prettier that could do what you want: https://dprint.dev/plugins/prettier/ |
Beta Was this translation helpful? Give feedback.
-
If I understand correctly, this implies
Instead of this:
I'm using an NVMe SSD with write-caching, and the latency is still horrible |
Beta Was this translation helpful? Give feedback.
-
Prettier 4 will be much faster, you can check it out now: https://prettier.io/blog/2023/11/30/cli-deep-dive |
Beta Was this translation helpful? Give feedback.
-
Just messing around with setting up formatting on JavaScript/TypeScript files using Prettier. Currently my hack-y attempt is the following config:
When formatting JS/TS files it takes about 1-2 seconds to apply, which is exactly how long it takes to format using the cli command directly
cat {FILE} | npx prettier --parser typescript
, so I suspect it's my method of going about this. When saving any svelte file, and using that formatter, it's pretty much "instant", despite the fact that I think the svelteserver LSP uses prettier under the hood.If anyone has any other suggestions on how to go about this better I'd greatly appreciate any help!
Beta Was this translation helpful? Give feedback.
All reactions