[PR #4399] [MERGED] fix: prettier for json with comments #4783

Closed
opened 2026-03-17 02:17:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4399
Author: @anwarulislam
Created: 10/3/2024
Status: Merged
Merged: 10/3/2024
Merged by: @jamesgeorge007

Base: nextHead: fix/jsonc-prettier


📝 Commits (3)

📊 Changes

3 files changed (+413 additions, -52 deletions)

View changed files

📝 packages/hoppscotch-common/src/components/http/RawBody.vue (+2 -3)
packages/hoppscotch-common/src/helpers/editor/linting/jsoncPretty.ts (+258 -0)
📝 packages/hoppscotch-common/src/helpers/jsoncParse.ts (+153 -49)

📄 Description

What's changed

Enhancements to JSON's Comment Functionality. This pull request addresses an issue encountered with Prettier when parsing JSON strings containing comments.

Follow up of #4335.

  • Not Completed
  • Completed

Example JSON

{
  "id":       "first",
  "id":                  "second",
  "key": {
//another comment


    
    "another_key": "another_value",
  },
  //hello comment
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4399 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 10/3/2024 **Status:** ✅ Merged **Merged:** 10/3/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `fix/jsonc-prettier` --- ### 📝 Commits (3) - [`9b77216`](https://github.com/hoppscotch/hoppscotch/commit/9b77216ecb41fa957c4d0ed0dfcc18a52272e3bf) chore: improve jsoncparser - [`58fca81`](https://github.com/hoppscotch/hoppscotch/commit/58fca810c5fd8621d2f116d080867a04c3623589) fix: json prettier for jsonc - [`083e94b`](https://github.com/hoppscotch/hoppscotch/commit/083e94b6909a979724f159ffb0f74a84adc5649c) chore: cleanup ### 📊 Changes **3 files changed** (+413 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components/http/RawBody.vue` (+2 -3) ➕ `packages/hoppscotch-common/src/helpers/editor/linting/jsoncPretty.ts` (+258 -0) 📝 `packages/hoppscotch-common/src/helpers/jsoncParse.ts` (+153 -49) </details> ### 📄 Description ### What's changed Enhancements to JSON's Comment Functionality. This pull request addresses an issue encountered with Prettier when parsing JSON strings containing comments. Follow up of #4335. - [ ] Not Completed - [x] Completed ### Example JSON ```json { "id": "first", "id": "second", "key": { //another comment "another_key": "another_value", }, //hello comment } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:17:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4783
No description provided.