From 1435b2756c0052fd62ccc644bc2fc3cdfee8eb05 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 12 Oct 2019 12:26:07 -0500 Subject: [PATCH] docs/configuration: specify order of precedence (#6638) This updates the docs to show the search order of the config files. Order comes from: https://github.com/prettier/prettier/blob/3805034bdfe45722e31a1abf019d4368dfb8ae11/src/config/resolve-config.js#L35-L44 --- docs/configuration.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index ab7621c7c..b28f61c90 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -3,12 +3,12 @@ id: configuration title: Configuration File --- -Prettier uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) for configuration file support. This means you can configure prettier via: +Prettier uses [cosmiconfig](https://github.com/davidtheclark/cosmiconfig) for configuration file support. This means you can configure prettier via (in order of precedence): -- A `.prettierrc` file, written in YAML or JSON, with optional extensions: `.yaml/.yml/.json`. -- A `.prettierrc.toml` file, written in TOML (the `.toml` extension is _required_). -- A `prettier.config.js` or `.prettierrc.js` file that exports an object. - A `"prettier"` key in your `package.json` file. +- A `.prettierrc` file, written in JSON or YAML, with optional extensions: `.json/.yaml/.yml` (without extension takes precedence). +- A `.prettierrc.js` or `prettier.config.js` file that exports an object. +- A `.prettierrc.toml` file, written in TOML (the `.toml` extension is _required_). The configuration file will be resolved starting from the location of the file being formatted, and searching up the file tree until a config file is (or isn't) found.