Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

prettier-config-one

sajmoni10MIT0.2.1

My recommended prettier config

prettier, config, no semi

readme

prettier-config-one

My recommended prettier config

Options

semi: false

Why?

  • Less visual clutter
  • Easier to move code around
  • Semicolons are not needed 99%+ of the time, and Prettier can insert them when they are

singleQuote: true

Why?

  • Slightly less visual clutter
  • Doesn't require pressing "shift"
  • It's in the Google style guide

jsxSingleQuote: true

Why?

  • Consistent with singleQuote

singleAttributePerLine: true

Why?

  • Better git diff. Adding or removing props won't affect unrelated ones
  • More consistent to always have props on new lines

experimentalTernaries: true

Why?

  • Supposedly better readability

How to use - automatic setup

recommended

Use setup-prettier to automatically add prettier and this config

npx setup-prettier@latest

How to use - manual install

npm install --save-dev prettier-config-one

In your package.json or prettier config:

  "prettier": "prettier-config-one"