This repository hosts a wrapper around esformatter that formats JS code to follow the Caplin style guide. As esformatter can be used stand alone with configuration it's generally not required to wrap it. The reason it's wrapped is for convenience as this package depends on a set of required esformatter plugins. It also hosts the style guide esformatter configuration. So installing it will deal with plugins and configuration. This package can be used stand alone from the command line or as a required library.
To use as a stand alone CLI tool install it globally with the command.
$ npm i -g briandipalma/js-formatter
Once installed cd
into a directory with a src
subdirectory and run.
$ js-formatter
This will format all *.js
files in the src
directory.
$ js-formatter -t
Will format the tests
directory.
$ npm t