ale/autoload/ale/fixers/eslint.vim
Ray Zane cb56cbb714 There seems to be a bug in eslint that causes the --config option to
not detect node_modules correctly. The `-c` option, however, works fine.
2017-09-24 13:57:18 -04:00

19 lines
502 B
VimL

" Author: w0rp <devw0rp@gmail.com>
" Description: Fixing files with eslint.
function! ale#fixers#eslint#Fix(buffer) abort
let l:executable = ale#handlers#eslint#GetExecutable(a:buffer)
let l:config = ale#handlers#eslint#FindConfig(a:buffer)
if empty(l:config)
return 0
endif
return {
\ 'command': ale#node#Executable(a:buffer, l:executable)
\ . ' -c ' . ale#Escape(l:config)
\ . ' --fix %t',
\ 'read_temporary_file': 1,
\}
endfunction