diff --git a/readme.md b/readme.md index bff4d50b..1533ac75 100644 --- a/readme.md +++ b/readme.md @@ -221,14 +221,23 @@ Default: `false` Format code with [Prettier](https://github.com/prettier/prettier). -The [Prettier options](https://prettier.io/docs/en/options.html) will be read from the [Prettier config](https://prettier.io/docs/en/configuration.html) and if **not set** will be determined as follow: +[Prettier options](https://prettier.io/docs/en/options.html) will be based on your [Prettier config](https://prettier.io/docs/en/configuration.html). XO will then **merge** your options with its own defaults: - [semi](https://prettier.io/docs/en/options.html#semicolons): based on [semicolon](#semicolon) option - [useTabs](https://prettier.io/docs/en/options.html#tabs): based on [space](#space) option - [tabWidth](https://prettier.io/docs/en/options.html#tab-width): based on [space](#space) option - [trailingComma](https://prettier.io/docs/en/options.html#trailing-commas): `all` - [singleQuote](https://prettier.io/docs/en/options.html#quotes): `true` - [bracketSpacing](https://prettier.io/docs/en/options.html#bracket-spacing): `false` -- [bracketSameLine](https://prettier.io/docs/en/options.html#bracket-line): `false` + +To stick with Prettier's defaults, add this to your Prettier config: + +```js +module.exports = { + trailingComma: 'es5', + singleQuote: false, + bracketSpacing: true, +}; +``` If contradicting options are set for both Prettier and XO an error will be thrown.