Skip to content

Add JSON Formatter tool - #17

Merged
02karthik merged 2 commits into
mainfrom
claude/wizardly-mayer-xvsiaa
Aug 7, 2026
Merged

Add JSON Formatter tool#17
02karthik merged 2 commits into
mainfrom
claude/wizardly-mayer-xvsiaa

Conversation

@02karthik

Copy link
Copy Markdown
Collaborator

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

  • Beautify with 2-space, 4-space, or tab indentation
  • Minify to a single compact line
  • Sort keys — recursive, alphabetical, for stable and diffable output
  • Live validation with pinpoint line X, column Y error locations
  • Syntax highlighting for keys, strings, numbers, booleans, and null
  • Stats row: lines, characters, nesting depth, and key count
  • Copy input or output, load sample data, and input persists in localStorage

Checklist

  • It's a single file: json-formatter/index.html with all CSS + JS inline.
  • It is fully self-contained / offline — no remote fonts, scripts, styles, images, fetch, or import.
  • No analytics, trackers, or phone-home behavior.
  • Added a screenshot at screenshots/json-formatter.webp (via npm run screenshot json-formatter).
  • Registered the tool in tools.json (dir matches the folder name).
  • Bumped the top-level catalogVersion (25 → 26).
  • New tool — per-tool version is 1.
  • npm run validate passes locally.

Notes for reviewers

  • Design system: azure accent only, 24px card/button radii, and every colour — including the illustrative JSON syntax tokens — goes through a CSS variable defined in both :root and the prefers-color-scheme: dark block. Verified in both light and dark; the CTA flips polarity correctly (light azure fill + near-black label in dark).
  • Syntax highlighting is safe: the highlighter only ever tokenises JSON that the tool itself produced via JSON.stringify, and all text is HTML-escaped before insertion — no eval, no innerHTML of user input.
  • Error locations: parses the position out of the engine's SyntaxError and computes line/column; when the engine already reports line X column Y it's passed through unchanged to avoid duplication.
  • No network / no bridge: clipboard uses the async Clipboard API with a document.execCommand fallback; nothing else touches I/O.

Generated by Claude Code

claude and others added 2 commits August 6, 2026 19:44
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
@02karthik
02karthik merged commit 6f14e87 into main Aug 7, 2026
1 check passed
@02karthik
02karthik deleted the claude/wizardly-mayer-xvsiaa branch August 7, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants