docs(jsonc): document the accepted JSONC dialect and the TypeError from new - #7301
Open
tomas-zijdemans wants to merge 1 commit into
Open
docs(jsonc): document the accepted JSONC dialect and the TypeError from new#7301tomas-zijdemans wants to merge 1 commit into
new#7301tomas-zijdemans wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7301 +/- ##
=======================================
Coverage 95.03% 95.03%
=======================================
Files 617 617
Lines 51637 51637
Branches 9359 9359
=======================================
Hits 49075 49075
Misses 2021 2021
Partials 541 541 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tomas-zijdemans
force-pushed
the
docs-jsonc-parse-docs
branch
from
September 3, 2026 05:06
e3db9a1 to
73bf054
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents what
@std/jsoncaccepts. Doc comments only, no behavior change.The module doc linked to the VS Code JSONC page and left it at that, so the dialect was never stated in std's own docs. That got worse when
allowTrailingCommawas removed in #5119: trailing commas became unconditional, and nothing said so. Bothjsonc/mod.tsandparse()now spell out the three additions over JSON (line comments, block comments, trailing comma after the last member) and note that comments are discarded.parse()also gains a@throwsline for theTypeErrorit raises when called withnew. Thenew.targetguard is there in the code and covered by a test inparse_test.ts, but onlySyntaxErrorwas documented.One thing I left alone. CONTRIBUTING.md says
@param/@returnscome before@example, and jsonc does the opposite. So does most of the repo: 478 doc blocks put@examplefirst against 335 that don't, and siblingyaml/parse.tsuses the same layout as jsonc. Reordering one module would be churn, not a fix.deno fmt,deno lint,deno task lint:docs, and the jsonc suite (408 tests) all pass.I used Claude Code to help investigate and write this change.