2018-03-31 10:55:20 -04:00
|
|
|
" Author: carakan <carakan@gmail.com>
|
|
|
|
" Description: Fixing files with tslint.
|
|
|
|
|
|
|
|
function! ale#fixers#tslint#Fix(buffer) abort
|
2018-07-19 08:52:53 -04:00
|
|
|
let l:executable = ale#handlers#tslint#GetExecutable(a:buffer)
|
2018-03-31 10:55:20 -04:00
|
|
|
|
|
|
|
let l:tslint_config_path = ale#path#ResolveLocalPath(
|
|
|
|
\ a:buffer,
|
|
|
|
\ 'tslint.json',
|
|
|
|
\ ale#Var(a:buffer, 'typescript_tslint_config_path')
|
|
|
|
\)
|
|
|
|
let l:tslint_config_option = !empty(l:tslint_config_path)
|
|
|
|
\ ? ' -c ' . ale#Escape(l:tslint_config_path)
|
|
|
|
\ : ''
|
|
|
|
|
|
|
|
return {
|
|
|
|
\ 'command': ale#node#Executable(a:buffer, l:executable)
|
|
|
|
\ . l:tslint_config_option
|
2020-12-04 16:15:32 -05:00
|
|
|
\ . ' --outputAbsolutePaths --fix %t',
|
2018-03-31 10:55:20 -04:00
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\}
|
|
|
|
endfunction
|