summaryrefslogtreecommitdiff
path: root/ale_linters/javascript/jshint.vim
diff options
context:
space:
mode:
authorBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
committerBjorn Neergaard <bjorn@neersighted.com>2018-11-29 14:57:35 -0700
commitd2b0ae8108b2ee395d4eb43c49d68b322a023a30 (patch)
treebb8145e69bf1bcb8968b29cb1a68c47ceb83674d /ale_linters/javascript/jshint.vim
parentef641dda80f45cb979bc93c2513c6e10cbd8e42a (diff)
parent0a384a49d371838903d8401c5358ec60f3f4266d (diff)
downloadale-d2b0ae8108b2ee395d4eb43c49d68b322a023a30.zip
Merge branch 'master' into sridhars
Diffstat (limited to 'ale_linters/javascript/jshint.vim')
-rw-r--r--ale_linters/javascript/jshint.vim15
1 files changed, 5 insertions, 10 deletions
diff --git a/ale_linters/javascript/jshint.vim b/ale_linters/javascript/jshint.vim
index 2e9bb9fd..cb7f66fc 100644
--- a/ale_linters/javascript/jshint.vim
+++ b/ale_linters/javascript/jshint.vim
@@ -4,12 +4,6 @@
call ale#Set('javascript_jshint_executable', 'jshint')
call ale#Set('javascript_jshint_use_global', get(g:, 'ale_use_global_executables', 0))
-function! ale_linters#javascript#jshint#GetExecutable(buffer) abort
- return ale#node#FindExecutable(a:buffer, 'javascript_jshint', [
- \ 'node_modules/.bin/jshint',
- \])
-endfunction
-
function! ale_linters#javascript#jshint#GetCommand(buffer) abort
" Search for a local JShint config locaation, and default to a global one.
let l:jshint_config = ale#path#ResolveLocalPath(
@@ -18,21 +12,22 @@ function! ale_linters#javascript#jshint#GetCommand(buffer) abort
\ get(g:, 'ale_jshint_config_loc', '')
\)
- let l:command = ale#Escape(ale_linters#javascript#jshint#GetExecutable(a:buffer))
- let l:command .= ' --reporter unix --extract auto'
+ let l:command = '%e --reporter unix --extract auto'
if !empty(l:jshint_config)
let l:command .= ' --config ' . ale#Escape(l:jshint_config)
endif
- let l:command .= ' -'
+ let l:command .= ' --filename %s -'
return l:command
endfunction
call ale#linter#Define('javascript', {
\ 'name': 'jshint',
-\ 'executable_callback': 'ale_linters#javascript#jshint#GetExecutable',
+\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jshint', [
+\ 'node_modules/.bin/jshint',
+\ ]),
\ 'command_callback': 'ale_linters#javascript#jshint#GetCommand',
\ 'callback': 'ale#handlers#unix#HandleAsError',
\})