Skip to content

Instantly share code, notes, and snippets.

@mischah

mischah/How to.md

Last active May 4, 2018
Embed
What would you like to do?
VSCode Settings for formatting using Prettier

How to setup Prettier to manually format your code

  1. Install Prettier
  2. Update User Settings
    {
      "editor.formatOnPaste": false,
      "editor.formatOnSave": false,
    }
  3. Use it with:
    • CMD + Shift + P -> Format Document
    • CMD + Shift + P -> Format Selection
  4. Search for prettier in the Default User Settings in case you would like to adapt some formatting rules.

Alternatively you can set up the main formatting rules per project or in your user directory ~/ in a .prettierrc file like the following:

# See https://prettier.io/docs/en/options.html for available options
printWidth: 100
useTabs: true
singleQuote: true
bracketSpacing: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.