Add JSON Formatter tool - #17
Merged
Merged
Conversation
A single-file, fully offline JSON utility that beautifies, minifies, and validates JSON. Highlights: - Beautify with 2-space, 4-space, or tab indentation - Minify to a single line - Optional recursive key sorting for stable, diffable output - Live validation with pinpoint line/column error locations - Syntax highlighting (keys, strings, numbers, booleans, null) - Stats: line count, character count, nesting depth, key count - Copy input/output, sample data, and localStorage-backed persistence Follows the Hillnote design system — azure accent, 24px radii, tokenised colours with full light/dark support via prefers-color-scheme. No network, no eval, no remote assets. Registers the tool in tools.json and bumps catalogVersion to 26. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YPS7GR91Q3JUr6wx9qG851
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this tool?
JSON Formatter — a single-file, fully offline utility to beautify, minify, and validate JSON. It's for anyone who lands on a wall of unformatted JSON (an API response, a config, a copied payload) and wants it readable, valid, and copyable without leaving the workspace or sending data to a web service.
The catalog already has a developer-utility cluster (Diff Checker, Regex Tester, Contrast Checker, Markdown Table, Unit Converter) but nothing for JSON — the single most common structured format people paste around. This fills that gap. It was not attempted in any prior closed PR.
What it does
line X, column Yerror locationslocalStorageChecklist
json-formatter/index.htmlwith all CSS + JS inline.fetch, orimport.screenshots/json-formatter.webp(vianpm run screenshot json-formatter).tools.json(dirmatches the folder name).catalogVersion(25 → 26).versionis1.npm run validatepasses locally.Notes for reviewers
:rootand theprefers-color-scheme: darkblock. Verified in both light and dark; the CTA flips polarity correctly (light azure fill + near-black label in dark).JSON.stringify, and all text is HTML-escaped before insertion — noeval, noinnerHTMLof user input.SyntaxErrorand computes line/column; when the engine already reportsline X column Yit's passed through unchanged to avoid duplication.document.execCommandfallback; nothing else touches I/O.Generated by Claude Code