Skip to content

Commit d6ef389

Browse files
authored
fix(docs): Change the return type of format function (docs & types) (#751)
The return type was not updated when format function was changed to an async function. This patch changes the type from `string` to `Promise<string>`, this only affects language servers.
1 parent 26a574c commit d6ef389

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = format;
3838
* @param {String} options.logLevel - the level for the logs
3939
* (error, warn, info, debug, trace)
4040
* @param {Boolean} options.prettierLast - Run Prettier Last
41-
* @return {String} - the formatted string
41+
* @return {Promise<String>} - the formatted string
4242
*/
4343
async function format(options) {
4444
const { logLevel = getDefaultLogLevel() } = options;

types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ declare namespace format {
9090
* supplied configuration. The auto-formatting is limited to the issues that
9191
* Prettier and ESLint can automatically fix.
9292
*/
93-
declare function format(options: format.Options): string;
93+
declare function format(options: format.Options): Promise<string>;
9494

9595
export = format;

0 commit comments

Comments
 (0)