Cursor でファイル保存時に Prettier が動作しなくなった
claude code の時代だと言われてますが、よわよわなのでまだ Cursor をめちゃくちゃ使ってます。
Astro + TypeScript のプロジェクトを触っていて、ファイルの保存時 (On Save) 時に Prettier のフォーマッターが動作しなくなったのでメモ
_人人人人人人人人人人人人人人人人人人_ > 何もしてないのに動かなくなった! <  ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
環境
- Cursor: Version
2.3.41 - Prettier: Prettier - Code formatter 拡張
v12.1.1
🐞 状況
- Cursor で
.tsファイルを保存時に Prettier でのフォーマットが動作しない - 同じフォルダを VS Code で開くと
.tsファイルの保存時に Prettier のフォーマットが動作する
.vscode/settings.json
{ "prettier.prettierPath": "./node_modules/prettier", "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": true, "editor.formatOnPaste": false, "editor.formatOnSaveMode": "file", "editor.codeActionsOnSave": { "source.fixAll.eslint": "always" }, "[astro]": { "editor.defaultFormatter": "astro-build.astro-vscode", "editor.formatOnSave": true }, "markdown.preview.breaks": true, "[markdown]": { "files.trimTrailingWhitespace": false, "editor.wordWrapColumn": 80, "editor.wordWrap": "bounded" } }
VS Code で動作しているので、Prettier 拡張がインストールされており設定にも問題はないものと思われる
Cursor での問題
- エディター下部のバーに Prettier と表示されていない

- 出力 (output) タブで
Prettierが選択できない (選択肢に存在しない) - コマンドパレットで (
⌘ + Shift + P) でFormat Document With Prettierが選択肢として存在しない .ts保存時に書式設定拡張機能 'Prettier - Code formatter' はフォーマッタとして構成されていますが、'TypeScript'-ファイルをフォーマットできませんというエラーが表示される
Cursor で esbenp.prettier-vscode が認識されてなさそう (拡張の設定はできる)
✅️ 解決方法 (2026-01-19現在) Prettier の拡張を v11 にダウングレードする
No longer eligible as formatter for many types of files #3906 - prettier-vscode
Downgrading to 11.0.2 got it to work again for me.In Cursor, I tried disabling all plugins and removing all settings.json values, and then only enabled Prettier 12.0.1. It still was not able to find the formatter at all, and it didn't appear in the toolbar on the bottom-right as specified in the ticket.
Downgrading to 11.0.2 does the trick for now for those having issues in Cursor. I also attempted to replicate this issue with a coworker who was seemingly also on the same Cursor + Prettier extension versions as me, yet they were not able to replicate the issue. cf. No longer eligible as formatter for many types of files · Issue #3906 · prettier/prettier-vscode · GitHub
Prettier 拡張のダウングレード方法
- 拡張のアンインストールボタンから「特定のバージョンをインストール…」を選択

- インストールするバージョンを選択できるので、
v11系を選択

- v.11 系がインストールされたら「拡張機能の再起動」を選択 (この時 自動更新 のチェックも外しておく)

- 拡張再起動後に
.tsファイルを開いて、エディター下部にPrettierと表示されていれば OK

これで、.ts ファイルの保存時に Prettier でフォーマットされるようになりました!
原因が分かるのに 2 時間使った…
AIに聞いても延々設定をこねくり回されたので、結局自分で検索した…
おわり
[参考]

![キレイキレイ [医薬部外品] 薬用 泡ハンドソープ シトラスフルーティの香り 本体大型ポンプ 500ml+詰め替え 450ml 殺菌 キレイキレイ [医薬部外品] 薬用 泡ハンドソープ シトラスフルーティの香り 本体大型ポンプ 500ml+詰め替え 450ml 殺菌](https://m.media-amazon.com/images/I/51gfn2u6nHL._SL500_.jpg)