Skip to main content
Module

x/dprint/mod.ts>Formatter

JS formatter for dprint Wasm plugins.
Latest
interface Formatter
import { type Formatter } from "https://deno.land/x/dprint@0.2.1/mod.ts";

Formats code.

Methods

setConfig(globalConfig: GlobalConfiguration, pluginConfig: Record<string, unknown>): void

Sets the configuration.

getConfigDiagnostics(): ConfigurationDiagnostic[]

Gets the configuration diagnostics.

getResolvedConfig(): Record<string, unknown>

Gets the resolved configuration.

getPluginInfo(): PluginInfo

Gets the plugin info.

getLicenseText(): string

Gets the license text of the plugin.

formatText(
filePath: string,
fileText: string,
overrideConfig?: Record<string, unknown>,
): string

Formats the specified file text.