All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 call ale#Set('javascript_xo_executable', 'xo')
2 call ale#Set('javascript_xo_use_global', get(g:, 'ale_use_global_executables', 0))
3 call ale#Set('javascript_xo_options', '')
5 call ale#Set('typescript_xo_executable', 'xo')
6 call ale#Set('typescript_xo_use_global', get(g:, 'ale_use_global_executables', 0))
7 call ale#Set('typescript_xo_options', '')
9 function! ale#handlers#xo#GetExecutable(buffer) abort
10 let l:type = ale#handlers#xo#GetType(a:buffer)
12 return ale#path#FindExecutable(a:buffer, l:type . '_xo', [
13 \ 'node_modules/xo/cli.js',
14 \ 'node_modules/.bin/xo',
18 function! ale#handlers#xo#GetLintCommand(buffer) abort
19 return ale#Escape(ale#handlers#xo#GetExecutable(a:buffer))
20 \ . ale#Pad(ale#handlers#xo#GetOptions(a:buffer))
21 \ . ' --reporter json --stdin --stdin-filename %s'
24 function! ale#handlers#xo#GetOptions(buffer) abort
25 let l:type = ale#handlers#xo#GetType(a:buffer)
27 return ale#Var(a:buffer, l:type . '_xo_options')
30 " xo uses eslint and the output format is the same
31 function! ale#handlers#xo#HandleJSON(buffer, lines) abort
32 return ale#handlers#eslint#HandleJSON(a:buffer, a:lines)
35 function! ale#handlers#xo#GetType(buffer) abort
36 let l:filetype = getbufvar(a:buffer, '&filetype')
37 let l:type = 'javascript'
39 if l:filetype =~# 'typescript'
40 let l:type = 'typescript'