Closed SebastienElet closed 8 years ago
Yes, it could be achieved into https://github.com/krampstudio/webvim/blob/master/plugins/config.vim#L79
hello @SebastienElet , I think this is better when node_modules are nested.
" get eslintrc path
let eslintrcpath = findfile('.eslintrc', '.;')
autocmd FileType javascript let b:syntastic_checkers = eslintrcpath != '' ? ['eslint'] : ['jshint']
" find eslint beside eslintrcpath
let local_eslint = substitute(eslintrcpath, ".eslintrc", "", "") . "node_modules" . '/.bin/eslint'
if executable(local_eslint)
let g:syntastic_javascript_eslint_exec = local_eslint
endif
@SebastienElet I think you should only need to update the env PATH
to use ./node_modules/.bin
.
export PATH=./node_modules/.bin:$PATH;
It will works for any editor or project you use.
When you work on a project with eslint as dev-dependency, it's better to use it instead of using global one.
I use the fallowing vimL to do the job :
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.