Update, i just find the solution if anyone is having the same problem i have to add the following lines to user setting json

"editor.defaultFormatter": "esbenp.prettier-vscode",
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
Answer from Diegohp141 on Stack Overflow
๐ŸŒ
Drupal Consultations
kamranafzal.com โ€บ home โ€บ ai โ€บ how to format your code automatically in vs code using prettier
How to Format Your Code Automatically in VS Code Using Prettier - Drupal Consultations
July 20, 2025 - Find Editor: Format On Save and check the box to enable it. Now, when you save your file (Ctrl+S or Cmd+S), Prettier will instantly format your code.
๐ŸŒ
Builder.io
builder.io โ€บ blog โ€บ claude-code
How I use Claude Code (+ my best tips)
July 11, 2025 - It adds some hooks for what code should run before edits are accepted, such as run Prettier on a specific file, or after edits, like write a type check on a specific file to make sure that it only accepts good and correct files.
Discussions

prettier - problems with code formatting on save in vscode - Stack Overflow
I have vscode installed and also the prettier extension. In settings I select the option format on save. However, when saving the formatting of the code does not happen, I have to activate the format More on stackoverflow.com
๐ŸŒ stackoverflow.com
I have done all kinds of things but my prettier does not format on save.
Type: Bug I installed prettier, on user I checked format on save and checked the config. Well it does not format on save I have followed all kinds of videos but it doesnot work. I think I did somet... More on github.com
๐ŸŒ github.com
3
April 26, 2024
Prettier format on save is not working

Yeah i am having the same issue ๐Ÿ˜•, idk why its happening, that's why just do ctrl+shift+p and format document and you got your document formated! ๐Ÿ˜€

More on reddit.com
๐ŸŒ r/vscode
2
1
April 15, 2018
What's your approach to auto-formatting your project in VS Code?
Prettier plugin: DO NOT change any of the settings and setup a .prettierrc in your project. Set Prettier as your formatter and format on save. And then thankfully forget about formatting ever again, for you and your team. EDIT: Set your formatter with "Format document with..." > "Configure Default Formatter" More on reddit.com
๐ŸŒ r/react
13
2
March 17, 2023
๐ŸŒ
GitHub
yellowduck.be โ€บ posts โ€บ automatically-format-code-on-file-save-in-visual-studio-code
๐Ÿ”— Automatically format code on file save in Visual Studio Code
In this article, Iโ€™ll walk you through the steps to configure Visual Studio Code to automatically format your code each time you save a file. We'll use the VS Code extension called Prettier, one of the most widely adopted tools for enforcing code style in JavaScript, TypeScript, and many ...
๐ŸŒ
Scott Sauber
scottsauber.com โ€บ 2017 โ€บ 06 โ€บ 10 โ€บ prettier-format-on-save-never-worry-about-formatting-javascript-again
Prettier + Format On Save = Never worry about formatting JavaScript again โ€“ Scott Sauber
June 12, 2021 - I find when using Prettier, along with the Format On Save option in VS Code, I donโ€™t think about how to format my code anymore. I donโ€™t ever wonder โ€œoh should I put this on multiple lines or keep it all in one line?โ€ Instead, I focus on solving my problem, hit Save and let Prettier do the rest.
๐ŸŒ
DevDojo
devdojo.com โ€บ post โ€บ myogeshchavan97 โ€บ automatically-format-code-in-visual-studio-code-using-prettier
Automatically Format Code in Visual Studio Code Using Prettier - DevDojo
November 5, 2021 - ... To automatically format the file on save, In Visual Studio Code, press Control + Shift + P or Command + Shift + P (Mac) to open the command palette and type setting and then select Preferences: Open User Settings option.
๐ŸŒ
OpenReplay
blog.openreplay.com โ€บ using-prettier-with-vscode-to-write-javascript
Using Prettier with VSCode to write JavaScript
June 7, 2023 - To format your JavaScript code with Prettier in VSCode, use the โ€œFormat Documentโ€ command (Shift+Alt+F on Windows/Linux or Shift+Option+F on Mac) or set it up to format your code on save automatically.
Find elsewhere
๐ŸŒ
Robin Wieruch
robinwieruch.de โ€บ how-to-use-prettier-vscode
How to use Prettier in VS Code - Robin Wieruch
February 14, 2022 - How to install Prettier for VS Code (Visual Studio Code). Install Prettier, configure it globally to format on save, add further Prettier configuration on a global level, and use a local .prettierrc file ...
๐ŸŒ
Medium
masukmia.medium.com โ€บ how-to-install-and-configure-prettier-in-vscode-for-seamless-code-formatting-f7893a771066
How to Install and Configure Prettier in VSCode for Seamless Code Formatting | by Masuk Mia | Medium
October 13, 2024 - Integrating it with VSCode helps streamline code formatting, saving time and improving readability. Hereโ€™s how to install and configure Prettier in VSCode step by step. ... If you havenโ€™t already installed Visual Studio Code (VSCode), download it from the official website: ... Once VSCode ...
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ how-to-format-code-with-prettier-in-visual-studio-code
Format Code with Prettier in Visual Studio Code: Setup Guide | DigitalOcean
August 1, 2025 - Prettier Can Be Run Manually or Automatically on Save: With the Format Document command or by enabling Format On Save, you can ensure that your code is always formatted cleanly with minimal effort. You Can Customize Prettier to Match Your Preferences: Settings such as quote style, semicolon ...
๐ŸŒ
Tailwind CSS
tailwindcss.com โ€บ docs โ€บ editor-setup
Editor setup - Getting started - Tailwind CSS
Check out the project on GitHub to learn more, or add it to Visual Studio Code to get started now. We maintain an official Prettier plugin for Tailwind CSS that automatically sorts your classes following our recommended class order.
๐ŸŒ
JustAnswer
justanswer.com โ€บ computer โ€บ rd8ph-want-set-extension-prettier-vs-code-save.html
How to Set Prettier as VS Code Save Formatter?
To set Prettier as your default formatter in VS Code, open Settings (Ctrl+,), search for 'default formatter,' and select 'Prettier - Code formatter.' Then enable 'Format On Save' by searching for 'format on save' and checking the box. Ensure ...
๐ŸŒ
Visual Studio Code
code.visualstudio.com โ€บ docs โ€บ copilot โ€บ customization โ€บ hooks
Agent hooks in Visual Studio Code (Preview)
February 9, 2026 - Control approvals: Automatically approve safe operations while requiring confirmation for sensitive ones. The following example creates a hook that runs Prettier after every file edit. Create a .github/hooks/format.json file in your workspace: { "hooks": { "PostToolUse": [ { "type": "command", "command": "npx prettier --write \"$TOOL_INPUT_FILE_PATH\"" } ] } } After you save this file, VS Code automatically loads the hook.
๐ŸŒ
GitHub
github.com โ€บ prettier โ€บ prettier-vscode โ€บ issues โ€บ 3382
I have done all kinds of things but my prettier does not format on save. ยท Issue #3382 ยท prettier/prettier-vscode
April 26, 2024 - Type: Bug I installed prettier, on user I checked format on save and checked the config. Well it does not format on save I have followed all kinds of videos but it doesnot work. I think I did something wrong with the path. I even tried t...
Author ย  Tochiskool
๐ŸŒ
Prettier
prettier.io โ€บ docs โ€บ install
Install ยท Prettier
--check is like --write, but only checks that files are already formatted, rather than overwriting them. prettier --write and prettier --check are the most common ways to run Prettier. Formatting from the command line is a good way to get started, but you get the most from Prettier by running it from your editor, either via a keyboard shortcut or automatically whenever you save ...
๐ŸŒ
It's FOSS
itsfoss.com โ€บ vs-code-auto-format-code
Automatically Format Code On File Save in Visual Studio Code
May 18, 2025 - In some cases, you might want to save a file without applying formatting, for example, when working with generated code or temporary formatting quirks. To do that, open the Command Palette again and run โ€œSave Without Formatting.โ€ ยท Prettier works well out of the box, but you can customize how it formats your code by adding a .prettierrc configuration file at the root of your project.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-use-prettier-in-visual-studio-code
How To Use Prettier in Visual Studio Code
March 18, 2024 - Now, you need to type formatter, and then Editor: Default Formatter will pop up on the settings list: ... Now, Prettier is your default code formatter, but you might want to enable Visual Studio Code to automatically format code when you save files.
๐ŸŒ
npm
npmjs.com โ€บ package โ€บ eslint
eslint - npm
2 weeks ago - Using both tools is common, refer to Prettier's documentation to learn how to configure them to work well with each other. ESLint has full support for ECMAScript 3, 5, and every year from 2015 up until the most recent stage 4 specification (the default). You can set your desired ECMAScript syntax and other settings (like global variables) through configuration. ESLint's parser only officially supports the latest final ECMAScript standard.
      ยป npm install eslint
    
Published ย  Mar 06, 2026
Version ย  10.0.3
Author ย  Nicholas C. Zakas
Homepage ย  https://eslint.org
๐ŸŒ
Yogesh Chavan
blog.yogeshchavan.dev โ€บ automatically-format-code-on-file-save-in-visual-studio-code-using-prettier
Automatically Format Code On File Save in Visual Studio Code Using Pre
November 5, 2021 - ... To automatically format the file on save, In Visual Studio Code, press Control + Shift + P or Command + Shift + P (Mac) to open the command palette and type setting and then select Preferences: Open User Settings option.