Skip to content

format

Format the source code with Prettier.

Prettier finds the project’s own configuration itself. Only a project with none gets --config, pointing at FormatOptions.defaultConfigFilePath or at the shared configuration. .gitignore and .prettierignore are honored, as Prettier always does.

Import:

import { format } from '@mnaoumov/typescript-dev-toolkit/formatters/prettier';

Signature:

function format(options: FormatOptions | undefined): Promise<void>

Parameters:

Parameter Type Description
options FormatOptions | undefined The FormatOptions.

Returns: Promise<void> — A Promise that resolves when the source code has been formatted.


Links to this page: