All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: Ahmed El Gabri <@ahmedelgabri>
2 " Description: standardjs for JavaScript files
4 call ale#Set('javascript_standard_executable', 'standard')
5 call ale#Set('javascript_standard_use_global', get(g:, 'ale_use_global_executables', 0))
6 call ale#Set('javascript_standard_options', '')
8 function! ale_linters#javascript#standard#GetExecutable(buffer) abort
9 return ale#path#FindExecutable(a:buffer, 'javascript_standard', [
10 \ 'node_modules/standardx/bin/cmd.js',
11 \ 'node_modules/standard/bin/cmd.js',
12 \ 'node_modules/semistandard/bin/cmd.js',
13 \ 'node_modules/.bin/standard',
17 function! ale_linters#javascript#standard#GetCommand(buffer) abort
18 let l:executable = ale_linters#javascript#standard#GetExecutable(a:buffer)
19 let l:options = ale#Var(a:buffer, 'javascript_standard_options')
21 return ale#node#Executable(a:buffer, l:executable)
22 \ . (!empty(l:options) ? ' ' . l:options : '')
26 " standard uses eslint and the output format is the same
27 call ale#linter#Define('javascript', {
29 \ 'executable': function('ale_linters#javascript#standard#GetExecutable'),
30 \ 'command': function('ale_linters#javascript#standard#GetCommand'),
31 \ 'callback': 'ale#handlers#eslint#Handle',