-
-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Labels
status: accepting prsPlease, send a pull request to resolve this!Please, send a pull request to resolve this!type: featureNew enhancement or requestNew enhancement or request
Milestone
Description
Feature Request Checklist
- I have pulled the latest
mainbranch of the repository. - I have searched for related issues and found none that matched my issue.
Overview
I'm finding it annoyingly difficult to read snapshots of generated package.json files:
| "package.json": "{"name":"test-repository","version":"0.0.0","description":"A very very very very very very very very very very very very very very very very long HTML-ish description ending with an emoji. 🧵","repository":{"type":"git","url":"git+https://github.com/test-owner/test-repository.git"},"license":"MIT","author":{"email":"npm@email.com"},"type":"module","main":"lib/index.js","files":["README.md","package.json"]}", |
It'd be nice to use @prettier/sync when producing file creations. That way their test snapshots look human-readable.
They're formatted at runtime with Prettier anyway if the user doesn't disable blockPrettier. I've never seen a user disable that block. But it's theoretically possible.
Additional Info
Previously filed as #2044. The problem with JSON.stringify is:
- It adds
\ns in many more cases than Prettier - Prettier will pick up on those cases and preserve them in its own formatting
- As a result, some output files have unnecessary
\ns that make them take more lines than needed
Metadata
Metadata
Assignees
Labels
status: accepting prsPlease, send a pull request to resolve this!Please, send a pull request to resolve this!type: featureNew enhancement or requestNew enhancement or request