fix: don't show inline JSON editor error for empty value#487
Conversation
There was a problem hiding this comment.
Pull request overview
Follow-up fix to prevent CodeMirror’s inline JSON lint errors from showing when the JsonEditor value is empty.
Changes:
- Skip JSON parsing linter when the editor content is empty/whitespace-only.
- Add a regression test ensuring no entry error and no inline lint markers for an empty value.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/components/entries/JsonEditor.js | Updates CodeMirror linter behavior to return no diagnostics for empty content. |
| test/spec/components/JsonEditor.spec.js | Adds validation test case for empty value with no errors shown. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nikku
left a comment
There was a problem hiding this comment.
@AlekseyManetov Looks good - please validate if 🤖 assertions for tests hold. We want to ensure that tests are green with the fix, and red (failing) without 🙃
491e7ee to
c6f8c7c
Compare
@nikku Copilot is wrong on this point. This was my first try with waitFor, but then I realized that it can’t be used for this case, because I've run the tests without my fix and they failed, so we're safe here. |
Proposed Changes
Small follow-up tweak for PR #485 to prevent inline editor errors from being shown for empty values.
Before:
After:
Checklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool