Ale function override of ale#handlers#eslint#FindConfig instead

This commit is contained in:
ManjaroOne666 2017-09-20 10:16:38 +01:00
parent 9da5f059e1
commit 7c9e8ae1f6
1 changed files with 2 additions and 11 deletions

13
vimrc
View File

@ -289,22 +289,13 @@ let g:ale_sign_error = '>>'
let g:ale_sign_warning = '--' let g:ale_sign_warning = '--'
let g:ale_sign_column_always = 1 let g:ale_sign_column_always = 1
"let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['jshint'], 'php':['php'], 'html':['htmlhint']}
let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], 'php':['php'], 'html':['htmlhint']} let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], 'php':['php'], 'html':['htmlhint']}
let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix' let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix'
let g:ale_javascript_eslint_options = '-c ~/.config/eslint/.eslintrc.js' let g:ale_javascript_eslint_options = '-c ~/.config/eslint/.eslintrc.js'
let g:ale_fixers = {'javascript': ['eslint']} let g:ale_fixers = {'javascript': ['eslint']}
"let g:ale_javascript_prettier_options = '--single-quote '
" override ALE's eslint fix function to use correct config file function! ale#handlers#eslint#FindConfig(buffer)
function! ale#fixers#eslint#Fix(buffer) abort return '/home/ray/.config/eslint/.eslintrc.js'
let l:executable = ale#handlers#eslint#GetExecutable(a:buffer)
return {
\ 'command': ale#node#Executable(a:buffer, l:executable)
\ . ' --config /home/ray/.config/eslint/.eslintrc.js'
\ . ' --fix %t',
\ 'read_temporary_file': 1,
\}
endfunction endfunction