Skip to content

writeConfigFile

writeConfigFile(file, config): Promise<void>

Write a configuration file: known keys in schema order, unknown keys after them in the order they already had, two-space indent, trailing newline. Parent directories are created.

The order is fixed so that writing an unchanged document produces an unchanged file — a config under version control should not churn its diff because a key moved.

Accepts a raw record as well as a TaskConfig, which is what makes the unknown-key-preserving edit path writable.

ParameterType
filestring
configRecord<string, unknown> | TaskConfig

Promise<void>