From e75ac9f4975be35e4f33b955f473ba5e336c9ca0 Mon Sep 17 00:00:00 2001 From: Charles B Johnson Date: Wed, 8 Apr 2020 18:52:53 -0500 Subject: fixers/xo: support typescript options --- autoload/ale/fixers/xo.vim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'autoload') diff --git a/autoload/ale/fixers/xo.vim b/autoload/ale/fixers/xo.vim index 06e58508..6c2901db 100644 --- a/autoload/ale/fixers/xo.vim +++ b/autoload/ale/fixers/xo.vim @@ -2,8 +2,17 @@ " Description: Fixing files with XO. function! ale#fixers#xo#Fix(buffer) abort - let l:executable = ale#handlers#xo#GetExecutable(a:buffer, 'javascript') - let l:options = ale#handlers#xo#GetOptions(a:buffer, 'javascript') + let l:filetype = getbufvar(a:buffer, '&filetype') + let l:type = '' + + if l:filetype =~# 'javascript' + let l:type = 'javascript' + elseif l:filetype =~# 'typescript' + let l:type = 'typescript' + endif + + let l:executable = ale#handlers#xo#GetExecutable(a:buffer, l:type) + let l:options = ale#handlers#xo#GetOptions(a:buffer, l:type) return { \ 'command': ale#node#Executable(a:buffer, l:executable) -- cgit v1.2.3