Skip to content

Conversation

@fisker
Copy link
Member

@fisker fisker commented Dec 19, 2023

Description

Fixes #15553

Checklist

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory).
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

docs/options.md Outdated
Comment on lines 118 to 119
<!-- TODO[@fisker]: Check this -->
If this option is set to `preserve`, `singleQuote` to `false` (default value), and `parser` to `json5`, double quotes are always used for strings. This effectively allows using the `json5` parser for “JSON with comments and trailing commas”.
Copy link
Member Author

Choose a reason for hiding this comment

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

@thorn0 Do you think I can revert #10323?

Copy link
Member

Choose a reason for hiding this comment

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

It'd be a breaking change with little gain. Maybe better to keep the logic and just remove this part from the docs.

Copy link
Member Author

Choose a reason for hiding this comment

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

createLanguage(linguistLanguages["JSON with Comments"], () => ({
parsers: ["jsonc"],
vscodeLanguageIds: ["jsonc"],
filenames: [...data.filenames, ".eslintrc"],
Copy link
Member Author

Choose a reason for hiding this comment

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

@fisker fisker marked this pull request as ready for review December 19, 2023 07:59
@fisker fisker merged commit 1dc924f into prettier:main Jan 2, 2024
@fisker fisker deleted the jsonc-parser branch January 2, 2024 02:59
medikoo pushed a commit to medikoo/prettier-elastic that referenced this pull request Feb 17, 2024
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

Successfully merging this pull request may close these issues.

Prettier should format JSONC with trailing commas

3 participants