mirror of
https://github.com/dense-analysis/ale.git
synced 2026-05-18 14:29:50 +08:00
Add new fixer tslint for typescript, fixes #932
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
" Author: carakan <carakan@gmail.com>
|
||||
" Description: Fixing files with tslint.
|
||||
|
||||
function! ale#fixers#tslint#Fix(buffer) abort
|
||||
let l:executable = ale_linters#typescript#tslint#GetExecutable(a:buffer)
|
||||
|
||||
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
|
||||
\ . ' --fix %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user