In addition deno fmt can format code snippets in Markdown files. Snippets must be enclosed in triple backtics and have a language attribute.

    Ignore formatting code by preceding it with a // deno-fmt-ignore comment in TS/JS/JSONC:

    1. // deno-fmt-ignore
    2. 1, 0, 0,
    3. 0, 1, 0,
    4. 0, 0, 1,

    In markdown you may use a comment or ignore a whole file with a <!-- deno-fmt-ignore-file --> comment. To ignore a section of markdown, surround the code with <!-- deno-fmt-ignore-start --> and <!-- deno-fmt-ignore-end --> comments.

    Configuration

    ℹ️ It is recommended to stick with default options.

    Starting with Deno v1.14 a formatter can be customized using either a configuration file or following CLI flags:

    • --options-line-width - The width of a line the printer will try to stay under. Note that the printer may exceed this width in certain cases. Defaults to 80.

    • --options-indent-width - The number of characters for an indent. Defaults to 2.