Skip to content

formatFiles(tree, options?): Promise<void>

Formats the created or updated files using Prettier, skipping node_modules, .git, the nx and yarn caches, and anything the workspace’s root .gitignore or .prettierignore covers

NameTypeDescription
treeTreethe file system tree
options?Objectoptions for the formatFiles function
options.sortRootTsconfigPaths?boolean-

Promise<void>

Remarks

Set the environment variable NX_SKIP_FORMAT to true to skip Prettier formatting. This is useful for repositories that use alternative formatters like Biome, dprint, or have custom formatting requirements.

Note: NX_SKIP_FORMAT only skips Prettier formatting. TSConfig path sorting (controlled by sortRootTsconfigPaths option or NX_FORMAT_SORT_TSCONFIG_PATHS) will still occur.