format_directory.ts

Declarations
#

view source

format_directory
#

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 Logger

dir

type string

check

type boolean
default false

extensions

type string
default EXTENSIONS_DEFAULT

root_paths

type string
default ROOT_PATHS_DEFAULT

prettier_cli

type string | Cli
default PRETTIER_CLI_DEFAULT

pm_cli

type string
default PM_CLI_DEFAULT

returns

Promise<SpawnResult>

Depends on
#

Imported by
#