Prettier doesn't work in Cursor

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Formatting shortcut doesn’t work, neither does format-on-save. However, Prettier did work as expected in the same project with VS Code.

Steps to Reproduce

Install Prettier - Code formatter extension.

Operating System

MacOS

Version Information

Version: 3.1.10
VSCode Version: 1.105.1
Commit: dacbe9b31599a253763e4910eb6ab38704653320
Date: 2026-04-13T11:39:16.806Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.1.0

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report. I need a couple quick details to figure out which of the two known cases this is:

  1. Are you formatting a file opened in the new Agents window Cursor 3, or in the classic editor a normal file tab? In the new Agent view, format on save doesn’t work yet. It’s a known limitation we’re tracking: Autoformat on save not happening in new agent view. Workaround is to open the file in the regular editor.

  2. If it’s the classic editor, which version of the Prettier extension do you have installed? And what does it show in Output > Prettier when you try to format? Also, please share a screenshot of Cmd+Shift+P then Format Document With… so we can see if Prettier shows up as a registered formatter.

That should help confirm if this is a Glass bug or something with the extension install.

It’s case 1, thanks!

For me, it’s the 2nd case. I’ve Prettier - Code formatter version 12.4.0 installed.
The Output > Prettier shows this when I first open the project, but doesn’t show anything else after hitting the formatting shortcut.

[“INFO” - 下午3:04:24] EditorConfig support is enabled, checking for .editorconfig files

[“INFO” - 下午3:04:24] Resolved config:

{

“tabWidth”: 2,

“semi”: false,

“singleQuote”: true,

“trailingComma”: “none”

}

The screenshot:

Apparently, cusor has been using the Typescript and JavaScript Language Features formatting even though I have Pretter - Code formatter set as the default formatter. If I hit Format Document With…, the Output > Prettier shows:

[“INFO” - 下午3:12:03] Formatting completed in 54ms.

@David_Ho, thanks for the screenshots, it’s clear now: this isn’t a Cursor bug, it’s a settings conflict. In the second screenshot, the TS/JS (default) formatter is set to TypeScript and JavaScript Language Features, not Prettier. That per-language default overrides the global Editor: Default Formatter. The “Also modified elsewhere” hint in the first screenshot is referring to this.

Two ways to fix it:

Method 1 (quick, via UI):

  • Open any .ts or .tsx file
  • Press Cmd+Shift+P and run Format Document With…
  • Pick Configure Default Formatter…
  • Select Prettier - Code formatter

Repeat for every language you format with Prettier, like js, jsx, tsx, json, css, etc.

Method 2 (via settings.json):

Press Cmd+Shift+P, run Preferences: Open User Settings (JSON), then add:

"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[javascriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
"[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }

Also check that your workspace settings don’t have conflicting values. Look in the Workspace tab in Settings or in .vscode/settings.json inside the project. That’s usually where the “elsewhere” warning comes from in Cursor.

Let me know if it still doesn’t work after that.