Documentation menu

Commands

flog formatEXPERIMENTAL

Experimental: Formatting rules and supported syntax may change before stabilization. Unsupported or unsafe files are still refused without edits.

Format JavaScript and TypeScript files when their complete contents are supported safely.

Usage#

flog format [--check] <file-or-directory ...>
flog format [--check] --workspace <selector>

Examples#

flog format src/config.js scripts/check.ts
flog format --workspace @example/shared
flog format --check src/config.js scripts/check.ts

--check is read-only and exits 3 when one or more files need formatting. Unsupported or ambiguous syntax, CommonJS signals, unsafe files, and operational errors exit 1. Invalid command usage exits 2.

Explicit paths, directories, and one --workspace are supported. Supported files use ESM grammar and do not require a package manifest; explicitly CommonJS extensions are refused. Run flog help format for the complete current command contract.

Bounded source formatting documents accepted extensions, module/script selection, fixed style, safety guarantees, diagnostics, and deferred syntax.