Boneyard Tools

Prettierrc Generator

Toggle the Prettier options you care about, see the JSON update live, and copy a minimal .prettierrc that only lists the settings that differ from Prettier's defaults.

How to generate a .prettierrc

  1. Adjust the options you want, such as print width, quotes and semicolons.
  2. Watch the JSON update, showing only the settings that differ from the defaults.
  3. Copy the result into a .prettierrc file at the root of your project.

Examples

Single quotes, no semicolons, wider lines

semi: false, singleQuote: true, printWidth: 100
{
  "printWidth": 100,
  "semi": false,
  "singleQuote": true
}

Frequently asked questions

Why does the output only show some options?

The generator writes a minimal config: only the options that differ from Prettier's defaults are included. This keeps the file short and easy to read.

What if I keep every setting at its default?

Then the output is an empty object, which is a valid .prettierrc. Prettier will simply use all of its default formatting rules.

Can I use this JSON in package.json instead?

Yes. Copy the object as the value of a 'prettier' key in package.json, or save it as a standalone .prettierrc, .prettierrc.json or prettier.config file.

What does trailingComma all mean?

It tells Prettier to add trailing commas wherever possible, including function parameters. It is the default in modern Prettier and works in current JavaScript.

Is my configuration private?

Yes. The file is built entirely in your browser and nothing is uploaded.

Related tools