auto fix your javascript using eslint
or fixmyjs
or jscs
or tslint
Bundle 'ruanyl/vim-fixmyjs'
Plug 'ruanyl/vim-fixmyjs'
-
Install
fixmyjs
oreslint
(ortslint
) globally, or have it in projectnode_modules
folder -
Config which autofix engine to use:
let g:fixmyjs_engine = 'eslint' (default) or let g:fixmyjs_engine = 'fixmyjs' or let g:fixmyjs_engine = 'jscs' or let g:fixmyjs_engine = 'tslint'
-
For convenience it is recommended that you assign a key for this, like so:
noremap <Leader><Leader>f :Fixmyjs<CR>
-
For fixmyjs to enable legacy mode:
let g:fixmyjs_legacy_jshint = 1