diff options
author | w0rp <devw0rp@gmail.com> | 2016-10-10 19:07:01 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2016-10-10 19:07:01 +0100 |
commit | 0680f875fe9ef07daceb3e9a90224bee613730df (patch) | |
tree | db3a9b229061e23535a91cda3f01ff68bebdc84e /ale_linters/javascript/jshint.vim | |
parent | 6f1ec7306dd1d4915171bc340290634de4c0b8e9 (diff) | |
download | ale-0680f875fe9ef07daceb3e9a90224bee613730df.zip |
Add an option for configuring the path for JSHint.
Diffstat (limited to 'ale_linters/javascript/jshint.vim')
-rw-r--r-- | ale_linters/javascript/jshint.vim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ale_linters/javascript/jshint.vim b/ale_linters/javascript/jshint.vim index 577e5c1b..a020ca0c 100644 --- a/ale_linters/javascript/jshint.vim +++ b/ale_linters/javascript/jshint.vim @@ -7,6 +7,9 @@ endif let g:loaded_ale_linters_javascript_jshint = 1 +let g:ale_javascript_jshint_executable = +\ get(g:, 'ale_javascript_jshint_executable', 'jshint') + function! ale_linters#javascript#jshint#GetCommand(buffer) " Set this to the location of the jshint configuration file to " use a fixed location for .jshintrc @@ -17,7 +20,7 @@ function! ale_linters#javascript#jshint#GetCommand(buffer) let jshint_config = ale#util#FindNearestFile(a:buffer, '.jshintrc') endif - let command = 'jshint --reporter unix' + let command = g:ale_javascript_jshint_executable . ' --reporter unix' if !empty(jshint_config) let command .= ' --config ' . fnameescape(jshint_config) @@ -69,14 +72,14 @@ endfunction call ALEAddLinter('javascript', { \ 'name': 'jshint', -\ 'executable': 'jshint', +\ 'executable': g:ale_javascript_jshint_executable, \ 'command_callback': 'ale_linters#javascript#jshint#GetCommand', \ 'callback': 'ale_linters#javascript#jshint#Handle', \}) call ALEAddLinter('javascript.jsx', { \ 'name': 'jshint', -\ 'executable': 'jshint', +\ 'executable': g:ale_javascript_jshint_executable, \ 'command_callback': 'ale_linters#javascript#jshint#GetCommand', \ 'callback': 'ale_linters#javascript#jshint#Handle', \}) |