Created
March 20, 2017 17:12
-
-
Save eborden/0fd936e7167a638ec295feddf4c90009 to your computer and use it in GitHub Desktop.
Enable Neomake eslint per buffer per project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Enable eslint for given project buffer | |
" Store current cwd | |
let s:prev_cwd = getcwd() | |
" change path to project root for current buffer | |
let s:project_cwd = split(expand('%:p:h'), "js")[0] | |
lcd `=s:project_cwd` | |
" Assign proper eslint vars for this buffer | |
let s:eslint_path = system('PATH=$(npm bin):$PATH && which eslint') | |
let b:neomake_javascript_eslint_exe = substitute(s:eslint_path, '^\n*\s*\(.\{-}\)\n*\s*$', '\1', '') | |
let b:neomake_javascript_enabled_makers = ['eslint'] | |
" change back to previous cwd | |
lcd `=s:prev_cwd` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment