Beautify code from editor

#1

A button and a shortcut to format code (JavaScript, HTML, CSS) in the current selection would be nice, maybe with rules that the user can define himself:

  • how many spaces to use
  • tab subsequent variables on next lines after a let foo = 'bar',
#2

Hi @superboss224, welcome to the Glitch forum!

We’re actively working on the Editor and are definitely considering features like this; thanks for the suggestion! Don’t forget to cast your own vote for it, or to vote for a similar suggestion like Prettier in Glitch, which I think represents the same idea.

In the meantime, many of us at Glitch use https://glitch-prettier-extension.glitch.me/ for this purpose, or https://github.com/potch/glitch-prettier for Firefox, both written by Glitch staff.

#3

How can I fix this. I cannot enable the prettier extension.
image

#4

Ugh, I forgot there were some changes to extension security policy in a recent Chrome update. Are you able to install the one from https://thoughtful-apogee.glitch.me/?

#5

No I am not, I get the same error as above.

#6

Hmm. Are you in developer mode on your chrome://extensions page? I was able to add and activate it without any trouble on Version 74.0.3729.131 (Official Build) (64-bit) for OS X.

#7

I am running on 74.0.3729.131 (Official Build) (64-bit) (cohort: Stable) just like you are. I have developer mode enabled and it still does not want to work for me!

#8

@Callum-OKane can you try in an incognito window or a brand new Chrome profile and see if that helps at all? We’ve definitely seen cases internally where the same person is able to install it on one instance of Chrome and not on another one, and we haven’t been able to suss out what the difference is.

Another option would be to clone the source repo at https://github.com/sheridanvk/glitch-prettier-extension and then install the unpacked extension from the extension directory therein.

1 Like
#9

I got it to work by unpacking the extension from the github download!

1 Like