d476578a40
* The project style linter now runs while you type. * Now the scripts for checking the project require blank lines. * Many style issues have been found and fixed.
26 lines
718 B
VimL
26 lines
718 B
VimL
" Author: Jeff Willette <jrwillette88@gmail.com>
|
|
" Description: Integration of importjs with ALE.
|
|
|
|
call ale#Set('javascript_importjs_executable', 'importjs')
|
|
|
|
function! ale#fixers#importjs#ProcessOutput(buffer, output) abort
|
|
let l:result = ale#util#FuzzyJSONDecode(a:output, [])
|
|
|
|
return split(get(l:result, 'fileContent', ''), "\n")
|
|
endfunction
|
|
|
|
function! ale#fixers#importjs#Fix(buffer) abort
|
|
let l:executable = ale#Var(a:buffer, 'javascript_importjs_executable')
|
|
|
|
if !executable(l:executable)
|
|
return 0
|
|
endif
|
|
|
|
return {
|
|
\ 'command': ale#Escape(l:executable)
|
|
\ . ' fix'
|
|
\ . ' %s',
|
|
\ 'process_with': 'ale#fixers#importjs#ProcessOutput',
|
|
\}
|
|
endfunction
|