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

fix: package.json pretty print Closes #4643 #4644

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

rkristelijn
Copy link
Contributor

@rkristelijn rkristelijn commented Jan 31, 2025

  • I've read and followed the contributing guide on how to create great pull requests.
  • I've updated the relevant documentation for any new or updated feature.
  • I've linked relevant GitHub issue with "Closes #".
  • I've added a visual demonstration in the form of a screenshot or video.

Closes #4643

@Janpot Janpot requested a review from bharatkashyap January 31, 2025 10:39
@bharatkashyap
Copy link
Member

Thanks @rkristelijn! Would a tab character be more close to pretty printing than 2 spaces? Going by https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#using_the_space_parameter

@rkristelijn
Copy link
Contributor Author

rkristelijn commented Jan 31, 2025

There is no Prettier config in the project. I’d recommend adding one using npx create-prettierrc, which defaults to 2 spaces per Prettier docs. If you prefer tabs, you can configure it there, and Prettier will ensure consistency. Do you want me to add it? I’d prefer the standard Prettier settings, but my goal was just to format package.json, so I’ll follow whatever direction you prefer.

Why 2 spaces instead of 1 tab?
• Consistency across editors – tabs can render differently depending on settings.
• Precise alignment – especially useful in nested structures.
• Industry standard – used in Next.js, MUI, Google Style Guide, and Prettier defaults.
• Prevents mixed indentation – avoiding unnecessary formatting issues.
• Aligns with JSON.stringify defaults – as mentioned in this MDN reference, 2 spaces is the convention when formatting JSON output.

Let me know what works best!

@bharatkashyap bharatkashyap added the create-toolpad-app Issues related to the `create-toolpad-app` CLI tool label Feb 3, 2025
@mui-bot
Copy link

mui-bot commented Feb 11, 2025

Netlify deploy preview

https://deploy-preview-4644--mui-toolpad-docs.netlify.app/

Generated by 🚫 dangerJS against 9d0d2e3

@bharatkashyap bharatkashyap merged commit 09a1f82 into mui:master Feb 11, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-toolpad-app Issues related to the `create-toolpad-app` CLI tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

package.json generates all on one line
3 participants