@@ -2,7 +2,8 @@ import fs, { WriteStream } from 'fs';
22import path from 'path' ;
33import { format } from 'util' ;
44import { parseChangelog , updateChangelog } from '@metamask/auto-changelog' ;
5- import prettier from 'prettier' ;
5+ import { format as formatPrettier } from 'prettier/standalone' ;
6+ import * as markdown from 'prettier/plugins/markdown' ;
67import { WriteStreamLike , readFile , writeFile , writeJsonFile } from './fs.js' ;
78import { isErrorWithCode } from './misc-utils.js' ;
89import {
@@ -278,7 +279,7 @@ export async function migrateUnreleasedChangelogChangesToRelease({
278279
279280 changelog . addRelease ( { version } ) ;
280281 changelog . migrateUnreleasedChangesToRelease ( version ) ;
281- await writeFile ( pkg . changelogPath , changelog . toString ( ) ) ;
282+ await writeFile ( pkg . changelogPath , await changelog . toString ( ) ) ;
282283}
283284
284285/**
@@ -288,8 +289,11 @@ export async function migrateUnreleasedChangelogChangesToRelease({
288289 * @param changelog - The changelog to format.
289290 * @returns The formatted changelog.
290291 */
291- export function formatChangelog ( changelog : string ) {
292- return prettier . format ( changelog , { parser : 'markdown' } ) ;
292+ export async function formatChangelog ( changelog : string ) {
293+ return await formatPrettier ( changelog , {
294+ parser : 'markdown' ,
295+ plugins : [ markdown ] ,
296+ } ) ;
293297}
294298
295299/**
0 commit comments