You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
Home > Project Editor > Will Glitch clean up my code formatting?
Will Glitch clean up my code formatting? print icon

Yes!

 

We support code formatting via the Format This File button available in the project editor. Click the button and we’ll clean up your code (and add a little magic sparkle, too!) You can also use the keyboard shortcut (ctrl-alt-S for PC, cmd+opt+S for Mac) to do this.

 

 

gif of "Format This File" in Glitch editor being pressed

 

 

Want to format just part of a file?

Highlight the lines you want to format, click the button, 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.

 

Want to customize the way Format This File works? 

We use the fabulous Prettier library for this, and have the default options applied. You can use a .prettierrc JSON configuration file in your project to set your own preferences. We will likely be supporting more languages in the future—if there’s something you’d like to see supported, you can let us know by posting in the Feedback section of our Community Forum.

 

Note:

When you use the keyboard shortcut, or if you have "reduce motion" set on your device, we won't animate with sparkles. We know you might not want to see them all the time. If you do want the magic sparkles, click the button!

Got more questions?  Check out our Community Forum

Open 24/7, the forum is where Glitch makers help each other and show off all the rad apps that they have created.  It's the friendliest community of coders on the Web!


 
Feedback
11 out of 15 found this helpful

scroll to top icon