With the extension Prettier-Code Formatter installed, set "editor.defaultFormatter": "esbenp.prettier-vscode" in User Settings.json. Reload the window, then open command palette, choose format document with, you would see prettier there. Try this and see if it solves your question. Answer from Molly_Wang on reddit.com
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ why my vs code pettier not working ?
r/vscode on Reddit: Why my VS code pettier not working ?
March 13, 2021 -

I have been searching google for several hours.

Many user have similar problem with me. https://stackoverflow.com/questions/52586965/why-does-prettier-does-not-format-code-in-vs-code/64273353#64273353

But none of the solution works for me.

https://imgur.com/2ssn1Vt

I have prettier installed. And I have tried the following

1.Command + Shift + p

2.type format document with

3.select Configure Default Formatter...

https://imgur.com/xw5oYvS

Then I cant select Prettier as default.

I only give me Python(default) as the only option.

I have a setting.json inside my root. Is it related?

https://imgur.com/KbEdsOV

๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ prettier not working as intended? (html formatting)
r/vscode on Reddit: Prettier not working as intended? (HTML formatting)
July 31, 2024 -

So, I'm starting to learn web dev, I'm at HTML right now, and using Linux.

The problem I'm having, is no matter what I tinker with in Prettier's settings, the formatting does behaviors I don't like, that mess with my ability to check visually and compare with the video tutorial (2022) I'm using, just a single line break being added or deleted makes it look like everything and anything could be different from the source video.

These behaviors include:

  1. Deleting line break before <head> and after </body> tags.

  2. Indenting head and body tags, instead of just their contents.

  3. Adding a line break inside a <li> element and indenting it because it contains a phrase having <a> and <abbr> tags, the closing </abbr> also gets a line break right before the '>' (apparently abbr tag is "breaking" because it has a period right after). ๐Ÿคฆ๐Ÿคฆ๐Ÿคฆ

I have set set the Print Width to 600 but it doesn't fix the 3rd problem.

Is there a VS Code feature that's just limited to adding indentation on format without messing with anything else? I'd like to know if there are fixes without having to disable Prettier if possible, but this is so ridiculous I may as well stop using it.

๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ suddenly prettier has stopped working with vscode?
r/vscode on Reddit: Suddenly prettier has stopped working with vscode?
February 28, 2023 -

Hello, I really need help, prettier just stopped working with react for no reason, as you can see it works with json files, but not react. What could be the reason? here is my settings.json:

{
  "editor.bracketPairColorization.enabled": true,
  "editor.accessibilitySupport": "off",
  "editor.formatOnSave": true,
  "typescript.updateImportsOnFileMove.enabled": "always",
  "editor.inlineSuggest.enabled": true,
  "github.copilot.enable": {
    "*": true,
    "yaml": false,
    "plaintext": true,
    "markdown": true
  },
  "window.zoomLevel": -2,
  "github.copilot.advanced": {},
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnPaste": true,
  "[typescriptreact]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
}

How can it suddenly stop working?

๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ prettier extension not working on html files
r/vscode on Reddit: Prettier extension not working on HTML files
January 29, 2022 -

I have Prettier setup as the default formatter already and it's working fine for JSX and JS files.

The weird thing is that it works on save, so when I save it formats HTML correctly, but if I try to do it manually I get: "Extension 'Prettier - Code formatter' is configured as formatter but it cannot format 'HTML'-files".

Find elsewhere
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ prettier stopped working suddenly and command "format document with" not found in command palette
r/vscode on Reddit: Prettier stopped working suddenly and Command "Format Document with" not found in Command Palette
May 15, 2021 - Prettier just suddenly stopped working and complained "Extension 'Prettier - Code Formatter' cannot format xxxx". A lot of the solutions online point to configuring default code formatter via the "Format Document with" in Command Palette instead of "Preference > Setting" but there is not any "Format Document with" command at all, just "Format Document". Any advice? I also tried clean uninstall vscode (deleting the extension files and everything) to no avail.
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ problem with prettier - code formatter
r/vscode on Reddit: problem with prettier - code formatter
August 25, 2022 -

I have a problem with prettier - code formatter

I installed prettier, it shows up in extensions, but when trying to use the extension in visual studio code, I can't use it.

I leave these images so you can see my problem and if you can help, I would greatly appreciate it.

๐ŸŒ
Reddit
reddit.com โ€บ r/javascript โ€บ [askjs] autoformatting issue with prettier and vscode
r/javascript on Reddit: [AskJS] Autoformatting issue with prettier and vscode
March 28, 2025 -

Hello, I am banging my head against a wall.

For long I had no autoformatting enabled in Vscode, when eslint (or prettier - I use the eslint prettier package) complained about some styling formatting I hovered over the error and clicked "Fix all problems" in Vscode.

But then I thought I finally need to setup the fix/format on save thingyโ€ฆ I enabled format on save in vscode settings And added this in my settings json in my project:

"editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll.eslint": true },

And it works!

But it seems I have some conflicting rules or stuff. Because I have something like this: some function => {} and when I hit save it formats to add a whitespace inside the curly braces: some function => { }

And here begins my problem. With the space I get an eslint error to remove the whitespace but when saving it adds it again. I am basically stuck lol

I tried to revert the settings in vscode but it keeps happening and I have no idea where to look for to fix this issue?

I will really appreciate any help or hints.

๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ prettier not working
r/vscode on Reddit: prettier not working
April 16, 2024 - ["INFO" - 9:50:21 PM] Extension Name: esbenp.prettier-vscode.
๐ŸŒ
Reddit
reddit.com โ€บ r/webdev โ€บ vs code: prettier extension not working
r/webdev on Reddit: VS Code: Prettier extension not working
August 29, 2023 -

I'm new to VS Code, and have just installed the Prettier extension so that my HTML / CSS is formatted neatly.

I've installed it, and set it as the default formatter... but still its not doing anything whenever I hit save?

๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ i have a problem to use prettier in vscode
r/vscode on Reddit: i have a problem to use prettier in vscode
September 14, 2022 - I installed prettier, it shows up in extensions, but when trying to use the extension in visual studio code, I can't use it. I leave these images so you can see my problem and if you can help, I would greatly appreciate it. ... As others have pointed out Prettier doesn't work for python. There may be a plugin for it in the community that would make it work but not sure and might just be easier to use an extension that is specifically for python. ... What vscode theme is this?
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ prettier extension not working
r/vscode on Reddit: Prettier extension not working
August 21, 2022 -

I'm new to VS Code, and have just installed the Prettier extension so that my HTML / CSS is formatted neatly.

I've installed it, and set it as the default formatter... but still its not doing anything whenever I hit save?

๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ prettier not formatting css
r/vscode on Reddit: Prettier not formatting css
September 24, 2024 -

Hey everyone, for the life of me I can't figure out why prettier won't format css. I have gone over all of my setting, format on save, setting prettier as the default format, and checked the setting.json file. Still can't figure out what is going on. Any help would be appreciated!

๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ trouble with prettier
r/vscode on Reddit: Trouble with Prettier
October 17, 2020 -

Guys, anybody got any experience with Prettier not working on VS Code? I've pretty much tried every solution online, including uninstalling and reinstalling Prettier and VS Code itself. I've also cleared a lot of cache as recommended somewhere and nothing changed. Prettier appears enabled and with all the correct settings activated. Any help greatly appreciated!