Skip to content

Commit

Permalink
Improved compatibility with Prettier v3 (alpha) (#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Oct 31, 2022
1 parent a5479ca commit 6cc4300
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/heavy-geckos-lick.md
@@ -0,0 +1,6 @@
---
"@changesets/apply-release-plan": patch
"@changesets/write": patch
---

Improved compatibility with the alpha releases of Prettier v3 by awaiting the `.format` result since it's a promise in that version.
3 changes: 2 additions & 1 deletion packages/apply-release-plan/src/index.ts
Expand Up @@ -350,7 +350,8 @@ async function writeFormattedMarkdownFile(
) {
await fs.writeFile(
filePath,
prettierInstance.format(content, {
// Prettier v3 returns a promise
await prettierInstance.format(content, {
...prettierConfig,
filepath: filePath,
parser: "markdown",
Expand Down
3 changes: 2 additions & 1 deletion packages/write/src/index.ts
Expand Up @@ -47,7 +47,8 @@ ${summary}

await fs.writeFile(
newChangesetPath,
prettierInstance.format(changesetContents, {
// Prettier v3 returns a promise
await prettierInstance.format(changesetContents, {
...prettierConfig,
parser: "markdown",
})
Expand Down

0 comments on commit 6cc4300

Please sign in to comment.