format_directory.ts view source
(log: Logger, dir: string, check?: boolean, extensions?: string, root_paths?: string, prettier_cli?: string | Cli, pm_cli?: string): Promise<SpawnResult> Formats a directory on the filesystem.
If the source directory is given, it also formats all of the root directory files.
This is separated from ./format_file to avoid importing all of the prettier code
inside modules that import this one. (which has a nontrivial cost)
log
type
Loggerdir
type
stringcheck
type
boolean default
falseextensions
type
string default
EXTENSIONS_DEFAULTroot_paths
type
string default
ROOT_PATHS_DEFAULTprettier_cli
type
string | Cli default
PRETTIER_CLI_DEFAULTpm_cli
type
string default
PM_CLI_DEFAULTreturns
Promise<SpawnResult>