Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lukebouch's avatar

VS Code Run Prettier on Save

What is the best way to have VS Code automaticity run Prettier on file save?

0 likes
4 replies
uniksk's avatar
uniksk
Best Answer
Level 1

Goto file > preferences > settings

and then search for Format on save and check the checkbox.

After that you can right click on the file you want to format and select Format Document With and choose prettier as default.

After that prettier will auto format your document every time you save.

Lukebouch's avatar

Thank you so much! I have been wondering how to do that for a while.

1 like
uniksk's avatar

Happy to help 😀😀.

If the solution solves your problem, then its good practice to mark the problem/thread as solved. It helps forum moderators as well as other to identity if the thread is solved or not.

Happy Coding !

Please or to participate in this conversation.