Smart JSON Formatter
Stop wasting vertical screen space. Smart JSON Formatter is a "fractal" formatter for VS Code. Unlike standard formatters that force every item onto a new line, this extension intelligently groups simple objects and lists onto single lines while keeping complex nested structures expanded. It optimizes for readability and information density. 🚀 Features
↔️ Comparison
Standard Formatter (Prettier / VS Code Default)Wastes space on simple data.
Smart JSON FormatterCompact, readable, and lightweight. Keys sorted alphabetically.
📋 RequirementsThis extension relies on a lightweight Python script to perform the layout calculations. Python 3 must be installed on your system. It must be available in your system path (terminal) as python3 (Mac/Linux) or python (Windows). Note: The extension automatically detects your OS to choose the correct command. 💻 UsageOpen any .json or .jsonc file. Right-click the editor and select Format Document With... Choose Smart JSON Formatter. To make it your default: Open a JSON file. Right-click -> Format Document With... -> Configure Default Formatter... Select Smart JSON Formatter. Now just press Shift + Alt + F (Mac: Shift + Option + F). ⚙️ Extension SettingsCurrently, the formatter operates with an opinionated standard configuration: Indent: 2 Spaces Max Width: 80 Characters Future updates may allow configuration of these values via VS Code Settings. 🔧 TroubleshootingError: "JSON Format Failed" Ensure the file is valid JSON. Open the Output panel or Developer Tools (Help > Toggle Developer Tools) to see the specific Python error. Error: "python3: command not found" Ensure Python is installed and added to your system's PATH environment variable. Publisher: David Ramirez License: MIT Tips for PublishingIf you decide to publish this to the actual VS Code Marketplace:
|