blob: a8f63ac0021d14a12c5ee984df67641db1c672c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import type { Options } from 'prettier';
import { format } from 'prettier';
import prettierConfig from '../../.prettierrc.js';
/**
* Formats markdown contents.
*
* @param text The text to format.
*/
export async function formatMarkdown(text: string): Promise<string> {
return format(text, prettierMarkdown);
}
/**
* Formats typedoc contents.
*
* @param text The text to format.
*/
export async function formatTypescript(text: string): Promise<string> {
return format(text, prettierTypescript);
}
const prettierMarkdown: Options = {
...prettierConfig,
parser: 'markdown',
};
const prettierTypescript: Options = {
...prettierConfig,
parser: 'typescript',
};
|