Docs: Update resolveConfigFile usage example (#6873)

This commit is contained in:
fisker Cheung authored and GitHub committed 2020-06-18 20:09:10 +08:00
1 parent 9ff0009a79
commit eb6ff31c26
1 file changed
+2 -4
+2 -4
View File
@@ -70,10 +70,8 @@ The promise will be rejected if there was an error parsing the configuration fil
The search starts at `process.cwd()`, or at `filePath` if provided. Please see the [cosmiconfig docs](https://github.com/davidtheclark/cosmiconfig#explorersearch) for details on how the resolving works.
```js
prettier.resolveConfigFile().then((filePath) => {
prettier.resolveConfig(filePath).then((options) => {
const formatted = prettier.format(text, options);
});
prettier.resolveConfigFile(filePath).then((configFile) => {
// you got the path of the configuration file
});
```