Skip to content

Commit

Permalink
Support prettier@3
Browse files Browse the repository at this point in the history
  • Loading branch information
timdp committed Jul 25, 2023
1 parent 1c0bdbf commit 718e5f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ async function format(options) {
const eslintFixed = await eslintFix(text, filePath);
return prettify(eslintFixed);
}
return eslintFix(prettify(text), filePath);
return eslintFix(await prettify(text), filePath);
}

function createPrettify(formatOptions, prettierPath) {
return function prettify(text) {
return async function prettify(text) {
logger.debug('calling prettier on text');
logger.trace(
stripIndent`
Expand All @@ -143,7 +143,7 @@ function createPrettify(formatOptions, prettierPath) {
const prettier = requireModule(prettierPath, 'prettier');
try {
logger.trace('calling prettier.format with the text and prettierOptions');
const output = prettier.format(text, formatOptions);
const output = await prettier.format(text, formatOptions);
logger.trace('prettier: output === input', output === text);
logger.trace(
stripIndent`
Expand Down

0 comments on commit 718e5f0

Please sign in to comment.