skip to Main Content

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 manually. how can I solve that ?

2

Answers


  1. Chosen as BEST ANSWER

    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"
      }
    

  2. Press Ctrl+shift+p and type Preferences: Open User Settings (JSON). In that json file add the following line and save. This should enable so vscode formats the code each time you save.

    {
    "editor.formatOnSave": true
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search