summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorCharles B Johnson <mail@cbjohnson.info>2020-04-08 18:52:53 -0500
committerCharles B Johnson <mail@cbjohnson.info>2021-01-22 09:23:53 -0600
commite75ac9f4975be35e4f33b955f473ba5e336c9ca0 (patch)
treedfbe99a46ed5382ffb42689deed3e35d3291a4f5 /autoload
parent289f808ccd3098cb19bc3bbbb274524a4fb85ff7 (diff)
downloadale-e75ac9f4975be35e4f33b955f473ba5e336c9ca0.zip
fixers/xo: support typescript options
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/fixers/xo.vim13
1 files changed, 11 insertions, 2 deletions
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)