Skip to content

detectFormatter

Chooses the formatter from the configuration files at the project root.

The order is dprint.json, then a Prettier configuration, then biome.json / biome.jsonc, so a project that lints with Biome and lays out with Prettier gets Prettier. A project with none of them gets dprint, as before Prettier and Biome were supported.

Import:

import { detectFormatter } from '@mnaoumov/typescript-dev-toolkit/formatters/auto';

Signature:

function detectFormatter(): Promise<Formatter>

Returns: Promise<Formatter> — The formatter to run.


Links to this page: