> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trunk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Prettier

> Explore Prettier, the powerful code formatter. Learn how to install, configure, and effectively use Prettier to enhance your coding workflow.

[**Prettier**](https://prettier.io/) is a formatter for CSS, SCSS, JavaScript, JSON, Markdown, TypeScript, GraphQL and YAML.

You can enable the Prettier formatter with:

```shell theme={null}
trunk check enable prettier
```

<Frame caption="Prettier example output">
  <img src="https://mintcdn.com/trunk-4cab4936/WAR0qJ1WO0rtUlqz/assets/code-quality/overview/linters/supported/prettier.gif?s=580e702488e339ace083b5d39b26070c" alt="prettier example output" width="1000" height="600" data-path="assets/code-quality/overview/linters/supported/prettier.gif" />
</Frame>

## Auto Enabling

Prettier will be auto-enabled if any *TypeScript, YAML, CSS, PostCSS, Sass, HTML, Markdown, JSON, JavaScript, GraphQL or Prettier\_supported\_configs* files are present.

## Settings

Prettier supports the following config files:

* `.prettierrc`
* `.prettierrc.json`
* `.prettierrc.yml`
* `.prettierrc.yaml`
* `.prettierrc.json5`
* `.prettierrc.js`
* `.prettierrc.cjs`
* `.prettierrc.mjs`
* `prettier.config.js`
* `prettier.config.cjs`
* `prettier.config.mjs`
* `.prettierrc.toml`
* `.prettierignore`

You can move these files to `.trunk/configs` and `trunk check` will still find them. See [Moving Linters](../configure-linters#moving-linters) for more info.

## Usage Notes

By default, Trunk uses Prettier to autoformat many languages/config formats, including markdown. To line wrap within markdown, you need to set the following in your [Prettier config](https://prettier.io/docs/en/configuration.html) `.prettierrc.yaml`, etc.

```yaml theme={null}
proseWrap: always
```

You may also want to configure `printWidth` to your liking.

## Links

* [Prettier site](https://prettier.io/)
* Prettier Trunk Code Quality [integration source](https://github.com/trunk-io/plugins/tree/main/linters/prettier)
* Trunk Code Quality's [open source plugins repo](https://github.com/trunk-io/plugins/tree/main)
