how to get prettier to work vs code code example

Example 1: prettier on save vscode

{
  "folders": [],
  "settings": {},
  "editor.formatOnSave": true,
}

Example 2: prettier config vscode

npm install --save-dev --save-exact prettier

Example 3: prettier on save vscode

// Set the default"editor.formatOnSave": false,// Enable per-language"[javascript]": {    "editor.formatOnSave": true}

Example 4: prettier set up with vs code

{  "trailingComma":"none",  "tabWidth": 4,  "semi": true,  "singleQuote": false}