summaryrefslogtreecommitdiff
path: root/ale_linters/javascript
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-10-06 13:42:52 +0100
committerw0rp <devw0rp@gmail.com>2016-10-06 13:42:52 +0100
commit3cdd057b11c224316af4d889783ea9c2d12b27f5 (patch)
tree6f395904f2c60137c948b4b504284b347cc273f2 /ale_linters/javascript
parent596a374c6ec080fbd667e1686729ed9173a725cb (diff)
downloadale-3cdd057b11c224316af4d889783ea9c2d12b27f5.zip
Add support for changing the eslint executable.
Diffstat (limited to 'ale_linters/javascript')
-rw-r--r--ale_linters/javascript/eslint.vim11
1 files changed, 7 insertions, 4 deletions
diff --git a/ale_linters/javascript/eslint.vim b/ale_linters/javascript/eslint.vim
index 28e61ea9..94d14e6b 100644
--- a/ale_linters/javascript/eslint.vim
+++ b/ale_linters/javascript/eslint.vim
@@ -7,6 +7,9 @@ endif
let g:loaded_ale_linters_javascript_eslint = 1
+let g:ale_javascript_eslint_executable =
+\ get(g:, 'ale_javascript_eslint_executable', 'eslint')
+
function! ale_linters#javascript#eslint#Handle(buffer, lines)
" Matches patterns line the following:
"
@@ -48,14 +51,14 @@ endfunction
call ALEAddLinter('javascript', {
\ 'name': 'eslint',
-\ 'executable': 'eslint',
-\ 'command': 'eslint -f unix --stdin --stdin-filename %s',
+\ 'executable': g:ale_javascript_eslint_executable,
+\ 'command': g:ale_javascript_eslint_executable . ' -f unix --stdin --stdin-filename %s',
\ 'callback': 'ale_linters#javascript#eslint#Handle',
\})
call ALEAddLinter('javascript.jsx', {
\ 'name': 'eslint',
-\ 'executable': 'eslint',
-\ 'command': 'eslint -f unix --stdin --stdin-filename %s',
+\ 'executable': g:ale_javascript_eslint_executable,
+\ 'command': g:ale_javascript_eslint_executable . ' -f unix --stdin --stdin-filename %s',
\ 'callback': 'ale_linters#javascript#eslint#Handle',
\})