atom-jsfmt
is a jsfmt
plugin for the Atom text editor. jsfmt
is really good at formatting, searching, and rewriting javascript. It's pretty nifty.
- Format your code: Run the
Jsfmt: Format
command to keep your code well-styled. - Format on save:
atom-jsfmt
will auto-format your javascript every time you save, so you don't have to think about it.
Installation can be done from Atom's package browser (just search for atom-jsfmt
). You can also use the apm
command line installer:
apm install atom-jsfmt
Although the default style guide is pretty good, you may find yourself wanting to tweak the formatting.
atom-jsfmt
looks for the closest .jsfmtrc
file before formatting (you can read more about them
here). It checks the directory of the current file,
and keeps moving up directories until it finds something.
For example, if you like your code indented four spaces, your .jsfmtrc
might look like this:
{
"indent": {
"value": " "
}
}
- Show Errors: Whether or not you want to see error messages. You probably do.
This is set to
true
by default. - Format On Save: Whether or not you automatically want to format your javascript
files when you save. Defaults to
true
.
- Look for
.jsfmtrc
files in all the places that the command line tool looks (like/etc/.jsfmtrc
or~/.jsfmtrc
). - Add searching / rewriting functionality
- Flag lines with errors
The changelog can be viewed here.
Atom-jsfmt is licensed under the MIT license, which can be viewed here.