Make your code Prettier

Ever wish you could snap your fingers and turn your code into a perfectly formatted masterpiece? Click the “Format This File” button (or use the handy keyboard shortcut) and we’ll magically clean up your current file.

|724.0000000000001x428

Want to format just part of a file? Highlight the lines you want to format, click the button or use the shortcut, and voila! It’s especially handy if you’re collaborating with people in the same file and don’t want to format the line they’re working on.

We use the fabulous Prettier library for this, and have the default options applied. Use a .prettierc JSON configuration file in your project to set your own preferences.

Thanks to all of you asking for this in the forum. We appreciate all of your feature ideas inspired from your creating on Glitch.com!

<3 Your friends at Glitch

6 Likes

Finally! It’s a pity that I recently left the Glitch and moved to own VPS.

On mobile side; something is wrong with the UI here:

On the last screenshot - there is a big gap between the editor and format button.

same, but put this in a reference of jsdoc, it glitches Jsdoc entirely every once in awhile, already found this out , cause i run the command 20+ times a minute

It doesn’t seem to be working for this one file on my site (https://glitch.com/edit/#!/megaphone?path=chat.html:1:0). Any thoughts?

will this work for ejs files in the future? Would be VERY helpful.

It’s a nice feature to complement this already-awesome platform, the sprinkles made my day. But is there a way to hide the button?
Because I oftenly clicked it and the whole structure changed. Of course I can have it undone with ctrl-z, but still :frowning:

You could try making a custom script for tampermonkey that hides this button, I do not know if that would work but it is worth a shot until they add a way to disable this button

THX, made my discord bot code look better a lot

Can we have this feature for java project please :slight_smile:

ESLint autofix in one click could be a nice addition too.

On the UI side, how about an option to show/hide such button(s)?

To hide, for now I just “inspect element” in browser, and then remove the button or it’s parent div (so you get full height for code).