Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable prettier for yaml files in vs code?

Tags:

yaml

prettier

I'm writing a very simple setup file for github actions part of my python project and sadly prettier keeps interrupting me with unnecessary warnings in the main.yml file inside of .github directory.

I've tried to add the code snippet below to my settings.json file but it does nothing and it is also marked as "Duplicate object key" since there's another entry of it below it:

    "editor.defaultFormatter": {
        "[yaml]": ""
    },
    "editor.defaultFormatter": "esbenp.prettier-vscode",

So this hasn't worked so far, I've also tried adding

    "[yaml]": {
        "editor.formatOnSave": false
    }

to the settings.json file but all of my efforts have been in vain!

like image 620
Navid Avatar asked Oct 20 '25 15:10

Navid


1 Answers

This one worked for me

  "[yaml]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": false
  },
like image 104
unickq Avatar answered Oct 23 '25 08:10

unickq