[Atom.io] Format JavaScript source code with atom-beautify

Tadashi Shigeoka ·  Mon, October 10, 2016

Since I wanted to use a formatter in a new JavaScript project, I tried using atom-beautify which nicely formats source code in Atom.

Atom.io

Installing atom-beautify

From the menu bar, go to [Atom] → [Preferences] → [Install], search for the atom-beautify package and install it.

If you’re managing with apm, run apm install atom-beautify.

How to configure atom-beautify

From the menu bar, go to [Atom] → [Preferences] → [Packages], and open the settings screen from atom-beautify’s Settings.

atom-beautify settings

In my case, for JavaScript settings I only changed the Indent size from the default 4 to 2, nothing else.

How to use atom-beautify

In the Atom editor, right-click and press “Beautify editor contents” to format JavaScript source code.

You can also format with the Control + alt(option) + b shortcut. Same for both Mac and Windows.

I’d like to introduce convenient tools like formatters to make development increasingly easier.

That’s all from the Gemba.