Skip to content

fix(json-editor): an empty document is never a lint error - #45

Merged
omercelikdev merged 1 commit into
mainfrom
json-editor-calm-empty
Aug 28, 2026
Merged

fix(json-editor): an empty document is never a lint error#45
omercelikdev merged 1 commit into
mainfrom
json-editor-calm-empty

Conversation

@omercelikdev

Copy link
Copy Markdown
Contributor

The JSON linter flagged an empty editor as a parse error — a red dot on line 1 of nothing. Found live on the api-portal console's commercial import box; the consumer's workaround (toggling lint off while empty) was worse: lint participates in the setup effect, so the first keystroke recreated the editor and stole the cursor.

  • The linter now answers no diagnostics for a zero-length document, and stays exactly as strict the moment content appears.
  • New fact: empty document renders no lint marker while broken JSON still does (the broken editor's marker is the clock for CodeMirror's lint delay).

Suite 199/199.

🤖 Generated with Claude Code

A blank editor is an invitation, not a mistake — the linter answers no
diagnostics for a zero-length document and stays exactly as strict the
moment content appears. Consumers no longer toggle `lint` for the empty
state, which recreated the editor mid-typing (lint participates in the
setup effect) and stole the cursor on the first keystroke.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@omercelikdev
omercelikdev merged commit 89e316b into main Aug 28, 2026
2 checks passed
@omercelikdev
omercelikdev deleted the json-editor-calm-empty branch August 28, 2026 11:12
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.

1 participant