Add XO formatter for JavaScript

This commit is contained in:
Sindre Sorhus 2017-01-12 21:31:13 +07:00
parent 3715e166a5
commit 1a09ff60fb
2 changed files with 14 additions and 1 deletions

View File

@ -157,6 +157,10 @@ Here is a list of formatprograms that are supported by default, and thus will be
It can be installed by running `npm install -g standard` (`nodejs` is required). No more configuration needed.
More information about the style guide can be found here: http://standardjs.com/.
* `xo` for __Javascript__.
It can be installed by running `npm install -g xo` (`nodejs` is required).
Here is the link to the repository: https://github.com/sindresorhus/xo.
* `html-beautify` for __HTML__.
It is shipped with `js-beautify`, which can be installed by running `npm install -g js-beautify`.
Note that `nodejs` is needed for this to work.
@ -307,6 +311,10 @@ contact me by creating an issue in this repository.
## Change log
### January 2017
* Add `xo` formatter for JavaScript.
### March 2016
* Don't use the option formatprg internally anymore, to always have the possible of using the default `gq`
command.

View File

@ -156,12 +156,17 @@ if !exists('g:formatdef_standard_javascript')
let g:formatdef_standard_javascript = '"standard --fix --stdin"'
endif
if !exists('g:formatdef_xo_javascript')
let g:formatdef_xo_javascript = '"xo --fix --stdin"'
endif
if !exists('g:formatters_javascript')
let g:formatters_javascript = [
\ 'jsbeautify_javascript',
\ 'pyjsbeautify_javascript',
\ 'jscs',
\ 'standard_javascript'
\ 'standard_javascript',
\ 'xo_javascript'
\ ]
endif