Skip to content

Prettier

Adam Doe edited this page Jan 5, 2023 · 1 revision

Prettier Formatting Suggestions

The pre commit hook should run automatically, but if you want to format your code as you go, this might help.

Add VS Code Prettier Extension

  • Type cmd+shift+X to open the extension finder and searching for “prettier”.
  • Verify the unique identifier is: esbenp.prettier-vscode
  • Download at your discretion

Change your User Settings JSON

  • Type cmd+shift+P to open the command palette and type “user settings”, you should see a JSON option, open that.
  • Change your format on save option:

editor.formatOnSave": true

  • Change your language formatting settings:
"[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
},