Skip to content

formatters/dprint

Format the source code.

Interface Description
FormatOptions Parameters for the format function.
Function Description
format Format the source code. Explicit FormatOptions.paths get --allow-no-files: a list dprint.json excludes entirely (a pre-commit hook staging only a demo-vault/ file) is nothing to format, not an error, while dprint would exit 14 with No files found to format. The whole-project run keeps the check, since finding nothing there is a broken configuration. Every run also excludes every .claude/settings.local.json, passed as --excludes=<pattern>, which dprint adds to the configuration’s own excludes, and which applies to an explicit path too. The = form is load-bearing: --excludes takes several values, so --excludes <pattern> would swallow the file list that follows it.