Skip to content

Allow comment only JSONC files#17269

Merged
fisker merged 7 commits intoprettier:mainfrom
fisker:jsonc-emty
Mar 20, 2025
Merged

Allow comment only JSONC files#17269
fisker merged 7 commits intoprettier:mainfrom
fisker:jsonc-emty

Conversation

@fisker
Copy link
Member

@fisker fisker commented Mar 19, 2025

Description

Allow this because jsonc-parse won't throw.

Fixes #17257

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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2025

Open in Stackblitz

npm i https://pkg.pr.new/prettier@17269

commit: e136628

@netlify
Copy link

netlify bot commented Mar 19, 2025

Deploy Preview for prettier ready!

Name Link
🔨 Latest commit e136628
🔍 Latest deploy log https://app.netlify.com/sites/prettier/deploys/67da3226c169170008454d3f
😎 Deploy Preview https://deploy-preview-17269--prettier.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@fisker fisker marked this pull request as ready for review March 19, 2025 02:45
@fisker fisker merged commit 5d8337e into prettier:main Mar 20, 2025
32 checks passed
@fisker fisker deleted the jsonc-emty branch March 20, 2025 15:01
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.

[JSONC] Document with only a comment gives SyntaxError

2 participants