@@ -2,7 +2,8 @@ import fs, { WriteStream } from 'fs';
2
2
import path from 'path' ;
3
3
import { format } from 'util' ;
4
4
import { 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' ;
6
7
import { WriteStreamLike , readFile , writeFile , writeJsonFile } from './fs.js' ;
7
8
import { isErrorWithCode } from './misc-utils.js' ;
8
9
import {
@@ -278,7 +279,7 @@ export async function migrateUnreleasedChangelogChangesToRelease({
278
279
279
280
changelog . addRelease ( { version } ) ;
280
281
changelog . migrateUnreleasedChangesToRelease ( version ) ;
281
- await writeFile ( pkg . changelogPath , changelog . toString ( ) ) ;
282
+ await writeFile ( pkg . changelogPath , await changelog . toString ( ) ) ;
282
283
}
283
284
284
285
/**
@@ -288,8 +289,11 @@ export async function migrateUnreleasedChangelogChangesToRelease({
288
289
* @param changelog - The changelog to format.
289
290
* @returns The formatted changelog.
290
291
*/
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
+ } ) ;
293
297
}
294
298
295
299
/**
0 commit comments