vscode prettier code example

Example 1: prittier download ubuntu

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

Example 2: prettier on save vscode

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

Example 3: format code in vs code

On Windows Shift + Alt + F.
On Mac Shift + Option + F.

Example 4: prettier on save vscode

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

Example 5: enable prettier vscode

ext install esbenp.prettier-vscode

Example 6: prettier install in vscode

Install node.js first