1
0
mirror of https://github.com/amix/vimrc synced 2025-02-28 14:12:51 +08:00

Fix for reading local eslint config for syntastic

This commit is contained in:
Max Alcala 2016-02-26 10:24:41 -06:00
parent 14bf4d01c6
commit 5acdca1297

View File

@ -143,8 +143,26 @@ func! SyntasticCheckCoffeescript()
execute "SyntasticCheck"
execute "Errors"
endfunc
nnoremap <silent> <leader>l :call SyntasticCheckCoffeescript()<cr>
" custom js/es6 syntastic check
func! SyntasticESlintChecker()
let l:npm_bin = ''
let l:eslint = 'eslint'
if executable('npm')
let l:npm_bin = split(system('npm bin'), '\n')[0]
endif
if strlen(l:npm_bin) && executable(l:npm_bin . '/eslint')
let l:eslint = l:npm_bin . '/eslint'
endif
let b:syntastic_javascript_eslint_exec = l:eslint
endfunc
autocmd FileType javascript :call SyntasticESlintChecker()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Git gutter (Git diff)