prettier / prettier-vscode

Visual Studio Code extension for Prettier
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
MIT License
5.14k stars 454 forks source link

Prettier formatting yaml files even though a different formatter is selected... #3467

Closed maxiedaniels closed 2 days ago

maxiedaniels commented 1 month ago

Very, very confused here, I have Prettier installed in VSCode and set as the default formatter, but in my VScode user config file i have:

    "[yaml]": {
        "editor.defaultFormatter": "redhat.vscode-yaml",
        ...

I have nothing in my workspace config. But when I go to my yaml file, i can see Prettier is the formatter, and if i format the doc, i can see the output that it's using prettier and not redhat.vscode-yaml.

Has anyone had this issue? It's driving me nuts. I realize i can disable prettier as my main formatter, but surely this should work?

edit I've now set default formatter to none, restarted, but prettier is still being used to format this yaml file.

coliff commented 1 month ago

A simple fix if I were in your situation would be to add a .prettierignore file in the root with:

*.yaml
cdwilson commented 1 month ago

I believe the redhat.vscode-yaml extension uses prettier under the hood:

https://github.com/redhat-developer/vscode-yaml/issues/266