Skip to content

Commit 2d61827

Browse files
committed
restore code from head of main
1 parent 21bef49 commit 2d61827

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { options as pugOptions } from './options';
1515
import { convergeOptions } from './options/converge';
1616
import type { PugPrinterOptions } from './printer';
1717
import { PugPrinter } from './printer';
18-
import { default as parseFrontmatter } from './utils/frontmatter/parse';
18+
import parseFrontmatter from './utils/frontmatter/parse';
1919

2020
/** Ast path stack entry. */
2121
interface AstPathStackEntry {
@@ -101,7 +101,8 @@ export const plugin: Plugin<AstPathStackEntry> = {
101101
},
102102
printers: {
103103
'pug-ast': {
104-
print(
104+
// @ts-expect-error: Prettier allow it to be async if we don't do recursively print
105+
async print(
105106
path: AstPath,
106107
options: ParserOptions & PugParserOptions,
107108
print: (path: AstPath) => Doc,
@@ -115,7 +116,7 @@ export const plugin: Plugin<AstPathStackEntry> = {
115116
pugOptions,
116117
frontmatter,
117118
);
118-
const result: string = printer.build();
119+
const result: string = await printer.build();
119120
logger.debug('[printers:pug-ast:print]:', result);
120121
return result;
121122
},

src/printer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { types } from 'node:util';
12
import type { BuiltInParserName, Options, RequiredOptions } from 'prettier';
23
import { format } from 'prettier';
34
import type PrettierAngularPlugin from 'prettier/plugins/angular';

0 commit comments

Comments
 (0)