Skip to content

Commit 6c8bcad

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Make functions async and add await to prepare for prettier v3 upgrade: 1/n (#52768)
Summary: Pull Request resolved: #52768 Prettier v3 has an async API. This diff adds in await ahead of the upgrade to prepare for the API change. Changelog: [Internal] Reviewed By: pieterv Differential Revision: D78752354 fbshipit-source-id: c0d27a6c863747b71852e72a22687d1fe1d9f76f
1 parent 7b5307d commit 6c8bcad

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

scripts/build/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ async function buildFile(
187187
const prettierConfig = {parser: 'babel'};
188188

189189
// Transform source file using Babel
190-
const transformed = prettier.format(
190+
const transformed = await prettier.format(
191191
(await babel.transformFileAsync(file, getBabelConfig(packageName))).code,
192192
/* $FlowFixMe[incompatible-call] Natural Inference rollout. See
193193
* https://fburl.com/workplace/6291gfvu */

scripts/js-api/build-types/buildApiSnapshot.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ async function getProcessedSnapshotResult(
262262
postTransforms(options),
263263
);
264264

265-
return prettier
266-
.format(transformedRollup, {
265+
return (
266+
await prettier.format(transformedRollup, {
267267
parser: 'typescript',
268268
semi: false,
269269
trailingComma: 'all',
270270
})
271-
.trimEnd();
271+
).trimEnd();
272272
}
273273

274274
async function generateConfigFiles(tempDirectory: string) {

0 commit comments

Comments
 (0)