VS Code Extensions
YAJF

YAJF

by itoleck

Json - Pretty, Ugly/Min, Newline Items, Newline Properties. By file and selection.

Downloads

0

Rating

(0)

Version

0.0.3

Last updated

Jul 24, 2026

A Visual Studio Code extension that formats .json (and .jsonc) files four different ways, on the whole document or just the current selection.

Formatting modes

Mode Description
JSON: Pretty Fully indented — each object property and each array item on its own line.
JSON: Ugly / Minimize Compact, single line, no whitespace.
JSON: Newline After Each Item Array items are expanded onto their own lines; objects stay inline.
JSON: Newline After Each Property Object properties are expanded onto their own lines; arrays stay inline.
JSON: Validate Document Validate the JSON, document only.

Each mode, except Validate has two variants:

  • Format Document — reformats the entire file.
  • Format Selection — reformats only the selected text (must be valid JSON on its own).

Usage

  1. Open a JSON file.
  2. Right-click in the editor and pick one of the YAJF commands, or
  3. Open the Command Palette (Ctrl+Shift+P) and search for YAJF.

Selection commands appear in the right-click menu only when text is selected.

Indentation follows the editor's Insert Spaces / Tab Size settings.

Example

Input:

{"name":"test","tags":["a","b"],"info":{"x":1,"y":2}}

Pretty

{
    "name": "test",
    "tags": [
        "a",
        "b"
    ],
    "info": {
        "x": 1,
        "y": 2
    }
}

Ugly / Minimize

{"name":"test","tags":["a","b"],"info":{"x":1,"y":2}}

Newline After Each Item

{"name":"test","tags":[
    "a",
    "b"
],"info":{"x":1,"y":2}}

Newline After Each Property

{
    "name": "test",
    "tags": ["a","b"],
    "info": {
        "x": 1,
        "y": 2
    }
}

Requirements

VS Code ^1.85.0.

License

MIT

Related extensions