Skip to content

Instantly share code, notes, and snippets.

@danielwrobert
Last active June 9, 2020 14:58
Show Gist options
  • Save danielwrobert/5a1204c5bd50bd5d11645bf0642ab75e to your computer and use it in GitHub Desktop.
Save danielwrobert/5a1204c5bd50bd5d11645bf0642ab75e to your computer and use it in GitHub Desktop.
My Prettier configuration files
{
"useTabs": true,
"tabWidth": 4,
"singleQuote": true,
"printWidth": 100
}
{
"useTabs": true,
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"parenSpacing": true,
"jsxBracketSameLine": false,
"semi": true,
"arrowParens": "avoid"
}
@danielwrobert
Copy link
Author

The only difference between the two above files is the "parenSpacing": true, option. This is added via the wp-prettier fork by Automattic.

To use this, you must install that fork of Prettier to your project. See directions in the README for that repo.

Be sure you're using the latest version (again, see README).

@danielwrobert
Copy link
Author

danielwrobert commented Jul 1, 2019

Change Log

  • 2020/06/09:
    • Remove endOfLine setting - Default value changed from auto to lf in v2.0.0
    • Remove trailingCommasetting - Default value changed fromnonetoes5` in v2.0.0
  • 2019/07/01: Updated settings to remove items that are set to what is already the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment