From 4b4a15b8428e79b6d22c6ce13575bf3289cbe42b Mon Sep 17 00:00:00 2001 From: Lucas Duailibe Date: Wed, 18 Oct 2017 01:16:02 -0200 Subject: [PATCH] doc(resolveConfig): document options.config (#3050) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8fa3e7592..538458a3d 100644 --- a/README.md +++ b/README.md @@ -470,8 +470,10 @@ prettier.formatWithCursor(" 1", { cursorOffset: 2 }); #### `prettier.resolveConfig(filePath [, options])` -`resolveConfig` can be used to resolve configuration for a given source file. -The function requires an input file path as an argument, you might want to pass `process.cwd()` for searching from the current working directory. +`resolveConfig` can be used to resolve configuration for a given source file, passing its path as the first argument. +The config search will start at the file path and continue to search up the directory (you can use `process.cwd()` to start +searching from the current directory). +Or you can pass directly the path of the config file as `options.config` if you don't wish to search for it. A promise is returned which will resolve to: * An options object, providing a [config file](#configuration-file) was found. * `null`, if no file was found.