doc(resolveConfig): document options.config (#3050)

master
Lucas Duailibe 2017-10-18 01:16:02 -02:00 committed by Lucas Azzola
parent 624d89e7a5
commit 4b4a15b842
1 changed files with 4 additions and 2 deletions

View File

@ -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.