Skip to content

Commit

Permalink
fix(docs): Change the return type of format function (docs & types) (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
IronBlood committed May 26, 2022
1 parent 26a574c commit d6ef389
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -38,7 +38,7 @@ module.exports = format;
* @param {String} options.logLevel - the level for the logs
* (error, warn, info, debug, trace)
* @param {Boolean} options.prettierLast - Run Prettier Last
* @return {String} - the formatted string
* @return {Promise<String>} - the formatted string
*/
async function format(options) {
const { logLevel = getDefaultLogLevel() } = options;
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Expand Up @@ -90,6 +90,6 @@ declare namespace format {
* supplied configuration. The auto-formatting is limited to the issues that
* Prettier and ESLint can automatically fix.
*/
declare function format(options: format.Options): string;
declare function format(options: format.Options): Promise<string>;

export = format;

0 comments on commit d6ef389

Please sign in to comment.