Skip to main content

๐Ÿ’… Prettier support

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

Setupโ€‹

The npm init sheriff-config command will spin up for you a default .prettierrc.json configuration. You can modify it if you need to, but it is discouraged. Act with caution.

If you don't use the npm init sheriff-config command, you will have to provide a prettier config yourself. Also don't forget the .prettierignore file.

If you already have a Prettier config in your project, you are good to go. The npm init sheriff-config command won't create a new Prettier config, nor will attempt to modify the existing one.

Usageโ€‹

By design, Sheriff doesn't incorporate:

Instead, for your local editing experience, it's recommended to install the Prettier editor extension.
If you want to enforce Prettier at pre-commit stage, see the official Prettier docs.
To enforce Prettier in CI, see the Prettier CLI docs.