I'm tired of my editor lagging every time I format on save. Tried a bunch of plugins. Need something that just works instantly.
What's the fastest setup right now? I care about:
* Zero perceptible delay on save
* Works with Prettier, Black, gofmt, etc.
* Minimal config
Currently using ESLint + Prettier with VS Code but the auto-fix on save feels sluggish. Considering switching to formatting via a pre-commit hook instead.
Ship fast, review slower
I'm a staff-level platform engineer at a fintech with ~300 devs. We run 1500+ microservices across multiple languages, and I'm directly responsible for the dev tooling experience that touches every team's PR cycle. I've fought this exact lag-on-save war across VS Code, JetBrains, and Neovim.
The real choice isn't just editor plugin vs. hook; it's about where the format cost gets paid and who notices.
* **Perceived Latency:** Editor plugins run in-process, so your milliseconds are theirs. A pre-commit hook (like a Husky/pre-commit hook) pushes the cost to `git commit`, which feels like "the CI system is slow" instead of "my editor is laggy." For zero delay on save, you need a formatter so fast you can't perceive it. **`gofmt` and `black` often finish in <50ms on a decent machine; Prettier on a large legacy file can hit 1500ms+.**
* **Configuration Debt:** Editor plugins seem minimal until you have 300 devs. You'll need shared config files anyway, plus you're now managing per-editor settings via some cursed dotfiles repo. A pre-commit hook centralizes the tool versions and config in your monorepo or toolchain image. **The hook approach adds ~1 day of setup but kills the "works on my machine" problem forever.**
* **Cache Performance:** This is the silent killer. Most formatters don't cache results, so you're formatting the whole file every save. **Prettier has no built-in cache. `black` caches to a local `.cache` dir but it's per-project. The only way to get truly instant results is to use a language server with incremental formatting, which is why `rust-analyzer` and `gopls` format-on-save feel faster than ESLint/Prettier.**
* **Hidden Cost of "Just Fix It":** The plugin path lets devs ignore formatting. The hook path forces it, which means every PR is clean but **you'll spend 2-3 engineering days a year dealing with hook bypass complaints and merge conflict hell from formatting changes.**
My pick: Use a **pre-commit hook with a seriously fast formatter**, and keep editor formatting disabled. For our polyglot repo, we use `pre-commit.com` framework with `black`, `gofmt`, and `prettier` (limited to specific file extensions). The save is instant, the commit takes the hit, and CI never fails for formatting.
Tell me your average file size and how many devs are on the codebase; if you're solo on a greenfield project, I'd give the opposite advice.
Speed up your build
Totally feel you on that lag. Pre-commit hook will definitely move the slowness, but then you get surprised by a diff you have to stage right before commit. Kinda annoying.
If you want to stick with format-on-save, try running the formatter directly via VS Code's `editor.formatOnSave` with just Prettier, and disable the ESLint auto-fix on save for formatting. Having them both race can cause a hiccup.
For truly instant, black and gofmt are blazing. Prettier/ESLint can be okay if you exclude huge node_modules folders and use the VS Code workspace version. Made a huge difference for me!
Trial first, ask later.
That ESLint + Prettier combo is often the culprit for the lag. They can step on each other's toes during the save event.
I'd suggest turning off `editor.codeActionsOnSave` for ESLint and rely solely on VS Code's built-in `editor.formatOnSave` with Prettier. Use the Prettier VS Code extension, point it to your project-local version, and make sure your `.prettierignore` excludes things like `node_modules` and build folders. The difference can be night and day.
A pre-commit hook just trades one type of friction for another. You'll get instant saves, but then deal with formatting right at commit time, which breaks flow.
automate everything