summaryrefslogtreecommitdiff
path: root/ale_linters/javascript/jscs.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/javascript/jscs.vim')
-rw-r--r--ale_linters/javascript/jscs.vim14
1 files changed, 4 insertions, 10 deletions
diff --git a/ale_linters/javascript/jscs.vim b/ale_linters/javascript/jscs.vim
index 60044037..a38766a6 100644
--- a/ale_linters/javascript/jscs.vim
+++ b/ale_linters/javascript/jscs.vim
@@ -4,12 +4,6 @@
call ale#Set('javascript_jscs_executable', 'jscs')
call ale#Set('javascript_jscs_use_global', get(g:, 'ale_use_global_executables', 0))
-function! ale_linters#javascript#jscs#GetExecutable(buffer) abort
- return ale#node#FindExecutable(a:buffer, 'javascript_jscs', [
- \ 'node_modules/.bin/jscs',
- \])
-endfunction
-
function! ale_linters#javascript#jscs#GetCommand(buffer) abort
" Search for a local JShint config locaation, and default to a global one.
let l:jscs_config = ale#path#ResolveLocalPath(
@@ -18,8 +12,7 @@ function! ale_linters#javascript#jscs#GetCommand(buffer) abort
\ get(g:, 'ale_jscs_config_loc', '')
\)
- let l:command = ale#Escape(ale_linters#javascript#jscs#GetExecutable(a:buffer))
- let l:command .= ' --reporter inline --no-colors'
+ let l:command = '%e --reporter inline --no-colors'
if !empty(l:jscs_config)
let l:command .= ' --config ' . ale#Escape(l:jscs_config)
@@ -60,8 +53,9 @@ endfunction
call ale#linter#Define('javascript', {
\ 'name': 'jscs',
-\ 'executable_callback': 'ale_linters#javascript#jscs#GetExecutable',
+\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jscs', [
+\ 'node_modules/.bin/jscs',
+\ ]),
\ 'command_callback': 'ale_linters#javascript#jscs#GetCommand',
\ 'callback': 'ale_linters#javascript#jscs#Handle',
\})
-