WebStorm Prettier Not Working
Quick answer
Prettier only formats files within the scope of the prettier dependency in package.json; check the Prettier plugin, the Run for files pattern and the status bar icon.
Most likely fix: Install and enable Prettier
How to fix it
Try these in order — the most common fix is first.
1. Install and enable Prettier
- Press Ctrl+Alt+S, open Plugins and make sure Prettier is enabled
- Run npm install --save-dev --save-exact prettier in the terminal
- Open Languages & Frameworks | JavaScript | Prettier and choose Automatic or Manual configuration
Did this fix it?2. Turn on Run on save
- In the Prettier settings select Run on save
- Check the Run for files pattern, for example add scss: **/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts,vue,astro,scss}
Did this fix it?3. Make Prettier the default formatter
- Select Manual Prettier configuration
- Select Run on 'Reformat Code' action
- Press Ctrl+Alt+L
Did this fix it?4. Read the status bar icon
- Hover the Prettier icon in the status bar to see the problem
- Use its menu to restart the language service, edit the config or open settings
Did this fix it?
Symptoms
Prettier does not format on save, Reformat Code ignores Prettier, or an error icon appears in the status bar.
Why it happens
- Prettier plugin disabled
- Prettier not installed in a node_modules folder within the file's scope
- File does not match the Run for files glob
- Wrong Node.js version or invalid Prettier package
- Language service stopped after its inactivity timeout (default 5 minutes)
This guide also covers
- webstorm prettier not working
- prettier on save webstorm
- webstorm prettier not formatting
Still not working?
If WebStorm keeps failing, you're not alone. See every WebStorm problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther WebStorm errors
- WebStorm Node.js Interpreter Not Configured
- WebStorm ESLint Not Working
- WebStorm TypeScript Language Service Errors and Slowness
- WebStorm Indexing Takes Forever
- WebStorm High Memory Usage: Increase Heap Size
- WebStorm Debugger Not Attaching or Breakpoints Not Hit
- WebStorm License Activation and Login Problems