-
Notifications
You must be signed in to change notification settings - Fork 349
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
Prettier code formatting #1092
Comments
Hey! Just to make sure, have you seen this guide/sandbox where we suggest a possible Prettier implementation? Hope it helps |
Thanks for the quick reply @danilowoz . I checked the sandbox out, but it seemed to work only when I set my User settings to enable prettier. I don't know how to do these settings with sandpack. |
Nevermind, got it to work. |
Hey @Graquick 👋, did you get this working with version Any advice is highly valued. :) |
Hey @faseehahmed1, YES I did! I'm working with an simple example to give to help you get started. You can expect it to be ready either today, or tomorrow (latest). |
Hey @faseehahmed1 once again. As promised, here's the sandbox: Sandpack with Prettier -sandbox Features
Notes
I remember struggling with this, and was so happy when I finally got it working. I really hope this will help you get back to coding fast! |
This is awesome @Graquick - thank you 🙌 |
Tell us how you think we can improve Sandpack
Packages affected
What is this feature?
Prettier code formatting.
How would your idea work?
Code in the active file of an editor would be formatted by Prettier, either 1. on type, or 2. on save. I have this currently configured in my CodeSandbox User settings, and it works perfectly.
Do you have any examples of how you would like to see us implement it?
I've tried adding
prettier
as a dev dependency, and providing asettings.json
file in the root, but with no success :(.Also I had to come up with a workaround for "saving" a file in the editor, as there isn't a builtin function for that. Not sure if this is where my issue stems from 🤷🏾♂️:
The text was updated successfully, but these errors were encountered: