forked from faker-js/faker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: reorganize apidoc scripts and reuse them for tests (faker-j…
- Loading branch information
1 parent
7ccf394
commit 969a232
Showing
11 changed files
with
379 additions
and
337 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import type { Options } from 'prettier'; | ||
import { format } from 'prettier'; | ||
import prettierConfig from '../../.prettierrc.cjs'; | ||
|
||
/** | ||
* Formats markdown contents. | ||
* | ||
* @param text The text to format. | ||
*/ | ||
export function formatMarkdown(text: string): string { | ||
return format(text, prettierMarkdown); | ||
} | ||
|
||
/** | ||
* Formats typedoc contents. | ||
* | ||
* @param text The text to format. | ||
*/ | ||
export function formatTypescript(text: string): string { | ||
return format(text, prettierTypescript); | ||
} | ||
|
||
const prettierMarkdown: Options = { | ||
...prettierConfig, | ||
parser: 'markdown', | ||
}; | ||
|
||
const prettierTypescript: Options = { | ||
...prettierConfig, | ||
parser: 'typescript', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.