mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-17 19:09:11 +03:00
bf0235c113
Co-authored-by: Teffen Ellis <teffen@nirri.us>
21 lines
494 B
JavaScript
21 lines
494 B
JavaScript
import { format } from "prettier";
|
|
|
|
import { AuthentikPrettierConfig } from "./constants.js";
|
|
|
|
/**
|
|
* Format using Prettier.
|
|
*
|
|
* Defaults to using the TypeScript parser.
|
|
*
|
|
* @category Formatting
|
|
* @param {string} fileContents The contents of the file to format.
|
|
*
|
|
* @returns {Promise<string>} The formatted file contents.
|
|
*/
|
|
export function formatWithPrettier(fileContents) {
|
|
return format(fileContents, {
|
|
...AuthentikPrettierConfig,
|
|
parser: "typescript",
|
|
});
|
|
}
|