@algolia/jsfmt

jsfmt your code using Algolia's JavaScript style guide.

Usage no npm install needed!

<script type="module">
  import algoliaJsfmt from 'https://cdn.skypack.dev/@algolia/jsfmt';
</script>

README

jsfmt

jsfmt your code using Algolia's JavaScript style guide.

Based on esformatter. Ths is not a fork of rdio/jsfmt.

Mostly done because there was not a single tool that could "reformat all the JavaScript but node_modules/ or dist/ ..". Which is what you want 100% of the time.

How to use

npm install -g @algolia/jsfmt
# or locally
npm install @algolia/jsfmt --save-dev
cd unstyled-JavaScript-project

# rewrite *.js recursively, ignoring node_modules
jsfmt

# rewrite only a folder (recursively)
jsfmt folder

# show the diff, without rewriting
jsfmt --diff