1
0
Fork 0
mirror of synced 2024-05-29 13:31:11 -04:00
ultimate-vim/sources_non_forked/ale/ale_linters/typescript/xo.vim

24 lines
918 B
VimL
Raw Normal View History

2019-05-17 10:09:13 -04:00
call ale#Set('typescript_xo_executable', 'xo')
call ale#Set('typescript_xo_use_global', get(g:, 'ale_use_global_executables', 0))
call ale#Set('typescript_xo_options', '')
function! ale_linters#typescript#xo#GetExecutable(buffer) abort
return ale#node#FindExecutable(a:buffer, 'typescript_xo', [
\ 'node_modules/.bin/xo',
\])
endfunction
function! ale_linters#typescript#xo#GetCommand(buffer) abort
return ale#Escape(ale_linters#typescript#xo#GetExecutable(a:buffer))
\ . ale#Pad(ale#Var(a:buffer, 'typescript_xo_options'))
2019-08-22 11:36:17 -04:00
\ . ' --reporter json --stdin --stdin-filename %s'
2019-05-17 10:09:13 -04:00
endfunction
" xo uses eslint and the output format is the same
call ale#linter#Define('typescript', {
\ 'name': 'xo',
\ 'executable': function('ale_linters#typescript#xo#GetExecutable'),
\ 'command': function('ale_linters#typescript#xo#GetCommand'),
2019-08-22 11:36:17 -04:00
\ 'callback': 'ale#handlers#eslint#HandleJSON',
2019-05-17 10:09:13 -04:00
\})