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:
parent
14bf4d01c6
commit
5acdca1297
@ -143,8 +143,26 @@ func! SyntasticCheckCoffeescript()
|
|||||||
execute "SyntasticCheck"
|
execute "SyntasticCheck"
|
||||||
execute "Errors"
|
execute "Errors"
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
nnoremap <silent> <leader>l :call SyntasticCheckCoffeescript()<cr>
|
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)
|
" => Git gutter (Git diff)
|
||||||
|
Loading…
Reference in New Issue
Block a user