- Add this line to your
.vimrc
:
Plug 'josudoey/vim-eslint-fix'
- Call
PlugInstall()
inside vim:
:PlugInstall
".vimrc
function! PrettyFile()
if &filetype=="javascript"
if exists('g:loaded_Beautifier')
call JsBeautify()
endif
if exists('g:loaded_ESLintFix')
call ESLintFix()
endif
end
endfunction
"pretty the file before saving.
autocmd BufWritePre * execute 'call PrettyFile()'