Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(jsonc): remove allowTrailingComma option #5119

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jun 24, 2024

What's changed

This change removes the ParseOptions.allowTrailingComma option, and therefore the ParseOptions interface. For now on, trailing commas are allowed (the previous default) without the ability to change.

Why this change was made

This change was made because setting ParseOptions.allowTrailingComma to false seemed to lack any useful use case. Also, having this added control also added some logic overhead. By removing this option, we slightly simplify the API surface of @std/jsonc while still remaining compatible with the majority of existing use cases.

Migration guide

No further action is needed for users that didn't use the options argument of parse() or set options.allowTrailingComma to true.

For users that set options.allowTrailingComma to false, parse() now no longer throws a SyntaxError when it encounters a trailing comma.

@github-actions github-actions bot added the jsonc label Jun 24, 2024
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.73%. Comparing base (65d4650) to head (a085512).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5119   +/-   ##
=======================================
  Coverage   92.72%   92.73%           
=======================================
  Files         479      479           
  Lines       38305    38294   -11     
  Branches     5394     5390    -4     
=======================================
- Hits        35520    35513    -7     
+ Misses       2732     2728    -4     
  Partials       53       53           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iuioiua iuioiua marked this pull request as ready for review June 24, 2024 08:47
@iuioiua iuioiua requested a review from kt3k as a code owner June 24, 2024 08:47
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iuioiua iuioiua merged commit 255b799 into main Jun 25, 2024
16 checks passed
@iuioiua iuioiua deleted the jsonc-remove-allowTrailingComma branch June 25, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants