Skip to content

🛠️ Tooling: Add spaces when printing JSON pre-formatter #2044

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Tooling Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch 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"]}",

They're formatted at runtime with Prettier anyway. But it'll be easier at dev time to poke at them with JSON.stringify(..., null, 2)

Additional Info

This technically could face users. But 🤷 nobody is removing blockPrettier that I know of.

🎁

Metadata

Metadata

Labels

area: toolingManaging the repository's maintenancetype: featureNew enhancement or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions