@thebespokepixel/xo-tidy v0.7.5
@thebespokepixel/xo-tidy
Automatic xo code formatter, geared toward post babel output.
Status
Developer
Help
Tidy (or lint) Babel/CoffeeScript output or just plain JavaScript to (something approaching) xo style. Mainly concerned with white space, indentation and ASI preferences.
Works as a CLI tool (piping stdin → stdout) and a vinyl stream formatter for gulp/through2. The CLI verbose modes can be very handy in spotting things that could be done better.
Usage
Installation
npm install --global @thebespokepixel/xo-tidy # For CLI use
npm i -D @thebespokepixel/xo-tidy # For programmatic use
// ES5
var xoTidy = require('@thebespokepixel/xo-tidy');
// or in Babel/ES2015+
import xoTidy from 'xoTidy'
Methods
formatText (string/buffer, options)
Simply give it source code as text, and it'll return formatted output, unless lint: true
, which will return linting information.
formatStdio (options)
Reads stdio directly and passes the output to stdout.
formatBuffer (options)
Useful for gulp tasks, or any other vinyl streams.
gulp.src(src)
.pipe(xoTidy.formatStream(options_))
.pipe(gulp.dest(dest))
Options object:
{
xopath: '.',
lint: false,
esnext: false,
semicolon: true,
space: false,
rules: {}
}
Documentation
Full documentation can be found at https://markgriffiths.github.io/xo-tidy/
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago