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

Add comma-dangle option #336

Open
rtritto opened this issue Oct 1, 2023 · 0 comments
Open

Add comma-dangle option #336

rtritto opened this issue Oct 1, 2023 · 0 comments
Assignees

Comments

@rtritto
Copy link

rtritto commented Oct 1, 2023

Add a comma-dangle boolean option.

Example

With:

const data = {
  key1: 'value1'
}

Case 1

Options:

JSON5.stringify(data, null, 2, { commaDangle: false, quote: '\'' })

Output:

{
  key1: 'value1'
}

Case 2 (Current behavior)

Options:

JSON5.stringify(data, null, 2, { commaDangle: true, quote: '\'' })

Output:

{
  key1: 'value1',
}
@jordanbtucker jordanbtucker self-assigned this Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants