JSON formatter's "Did you mean" hint reads inside strings, so a missing comma near a URL says to remove comments
I maintainer di solito rispondono entro 1 giorno
@kachamsiddarth ci sta già lavorando.
Dal 23/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Paste {"url": "https://example.com" "id": 1} into the JSON formatter. The error is right ("Expected ',' or '}' after property value"), but the "Did you mean" hint says "JSON doesn't support comments". There's no comment: the // is part of the URL. suggestFix (lib/json-utils.ts, lines 116 to 131) runs its checks on the raw text, including what's inside strings. Two more:
{"a": "{", "b" 1}(missing colon) gets "Unbalanced braces" (2 "{" vs 1 "}"){"note": "value is undefined" "x": 1}(missing comma) gets "JSON has noundefined"
What to do
- Run the checks on a copy of the input with the contents of double-quoted strings blanked out, for example
raw.replace(/"(?:[^"\\\n]|\\.)*"/g, '""'), so only text outside strings counts.
Where to look
lib/json-utils.ts:suggestFix(lines 116 to 131)lib/__tests__/json-utils.test.ts, throughvalidate(suggestFixisn't exported)
Acceptance criteria
- The three inputs above get no comments, braces or
undefinedhint - A real
//comment, a bareundefinedand a missing}still get their hints - Tests that fail on the current code
-
npm run lint,npm run testandnpm run buildpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #314 in the description.
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 9
- Merge medio
- 7h 30m
- PR unite (30g)
- 151
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codercops/toolbelt
-
fix(UI): shortcut popover overflowsForse già presa @DeepakNegi13 l’ha presa 1 giorno fa. Apertabug good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
codercops/toolbelt#333 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Timestamp converter turns "February 30, 2024" into March 1 instead of rejecting itForse già presa @bhushan4work l’ha presa oggi. Apertabug hacktoberfest help wanted
codercops/toolbelt#337 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Copy buttons in the URL encoder and JWT decoder are all named just "Copy"Forse già presa @bhushan4work l’ha presa oggi. Apertaaccessibility bug good first issue hacktoberfest
codercops/toolbelt#335 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Cron explainer says "on weekdays" for `0 0 1-31 * 1-5`, but the next runs include weekendsForse già presa @Saifjafri212213 l’ha presa 1 giorno fa. Apertabug hacktoberfest help wanted
codercops/toolbelt#329 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
UUID generator's v7 batch comes out in random order instead of time orderForse già presa @omisha123 l’ha presa 1 giorno fa. Apertabug good first issue hacktoberfest
codercops/toolbelt#316 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/toolbelt
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
awesome-dsh-plugin/awesome-dsh-plugin#9184 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
farion1231/cc-switch#8829 ·
I maintainer di solito rispondono entro 1 giorno
-
[core-client] Remove unused hand-maintained transport helpers after the definition-table cutoverApertadoc-audit enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100