Json5Formatter
No description provided
Details
Installs
- Total 2
- Win 0
- Mac 1
- Linux 1
| Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | Jul 12 | Jul 11 | Jul 10 | Jul 9 | Jul 8 | Jul 7 | Jul 6 | Jul 5 | Jul 4 | Jul 3 | Jul 2 | Jul 1 | Jun 30 | Jun 29 | Jun 28 | Jun 27 | Jun 26 | Jun 25 | Jun 24 | Jun 23 | Jun 22 | Jun 21 | Jun 20 | Jun 19 | Jun 18 | Jun 17 | Jun 16 | Jun 15 | Jun 14 | Jun 13 | Jun 12 | Jun 11 | Jun 10 | Jun 9 | Jun 8 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Mac | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Linux | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Json5Formatter
A Sublime Text plugin that formats JSON/JSON5 files using the system Python's json5 library.
Features
| Command | Description |
|---|---|
| JSON5: Format as JSON | Format and output standard JSON, preserving comments |
| JSON5: Format as JSON5 | Format as JSON5 style (comments not preserved) |
| JSON5: Minify | Compress to single-line JSON |
- Supports JSON5 syntax:
//and/* */comments, single-quoted strings, trailing commas, unquoted keys - Auto-converts single quotes → double quotes, unquoted keys → quoted keys
- Outputs standard JSON (no trailing commas)
Installation
Prerequisites
- Python 3.x (on system PATH)
json5library:pip install json5
Manual Install
Sublime Text 4
cd <Packages directory> (Preferences → Browse Packages...)
git clone git@github.com:RAMBOO1990/sublime-json5.git "Json5Formatter"
Usage
Command Palette
Press Ctrl+Shift+P, type JSON5:, and select the desired command.
Key Binding
| Keys | Command |
|---|---|
Ctrl+Shift+J |
Format as JSON |
Customize in Default.sublime-keymap.
Settings
Preferences → Package Settings → Json5Formatter → Settings
{
// Number of spaces per indent level
"indent": 4,
// Sort object keys alphabetically
"sort_keys": false,
// Escape non-ASCII characters
"ensure_ascii": false
}
sort_keysandensure_asciionly apply to the Format as JSON5 and Minify commands. Format as JSON uses the built-in formatter and does not currently support these options.
License
MIT