diff options
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/typescript/tsserver.vim | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ale_linters/typescript/tsserver.vim b/ale_linters/typescript/tsserver.vim new file mode 100644 index 00000000..332e32e5 --- /dev/null +++ b/ale_linters/typescript/tsserver.vim @@ -0,0 +1,23 @@ +" Author: w0rp <devw0rp@gmail.com> +" Description: tsserver integration for ALE + +call ale#Set('typescript_tsserver_executable', 'tsserver') +call ale#Set('typescript_tsserver_config_path', '') +call ale#Set('typescript_tsserver_use_global', 0) + +function! ale_linters#typescript#tsserver#GetExecutable(buffer) abort + return ale#node#FindExecutable(a:buffer, 'typescript_tsserver', [ + \ 'node_modules/.bin/tsserver', + \]) +endfunction + +function! ale_linters#typescript#tsserver#Handle(buffer, lines) abort + return a:lines +endfunction + +call ale#linter#Define('typescript', { +\ 'name': 'tsserver', +\ 'lsp': 'tsserver', +\ 'executable_callback': 'ale_linters#typescript#tsserver#GetExecutable', +\ 'callback': 'ale_linters#typescript#tsserver#Handle', +\}) |