Skip to main content

๐Ÿ’… Prettier support

Sheriff tries to incorporate Prettier out-of-the-box.

Setupโ€‹

The npm init @sherifforg/config command will spin up for you a default .prettierrc.json configuration. You can change it if you like, but it is discouraged. Act with caution.

If you do not use the npm init @sherifforg/config command, you need to create a Prettier config yourself, and remember to create a .prettierignore file!

If you already have a Prettier config in your project, you are good to go. The npm init @sherifforg/config command will not create a new Prettier config, nor will it attempt to change the existing one.

Usageโ€‹

By design, Sheriff does not incorporate:

Instead, for your local editing experience, we recommend installing a Prettier editor extension.
If you want to enforce Prettier with a pre-commit hook, see the official Prettier docs.
To enforce Prettier in CI, see the Prettier CLI docs.