# Prettier

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Usage](#usage)
  - [package.json (recommended)](#packagejson-recommended)
  - [Config file (when you need overrides)](#config-file-when-you-need-overrides)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Usage

Use the shared config through the supported `@box/frontend/prettier` entry
point, following Prettier’s
[shareable configs](https://prettier.io/docs/sharing-configurations) guidance.

Install `prettier@^3.8.3` alongside `@box/frontend`.

### package.json (recommended)

```json
{
  "prettier": "@box/frontend/prettier"
}
```

Remove any local `.prettierrc*` / `prettier.config.*` that only re-exported the
shared config.

### Config file (when you need overrides)

```js
// prettier.config.mjs
import boxPrettierConfig from '@box/frontend/prettier';

/**
 * @see https://prettier.io/docs/configuration
 * @type {import('prettier').Config}
 */
const config = {
  ...boxPrettierConfig,
  // local overrides
};

export default config;
```
