summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/javascript/standard.vim29
-rw-r--r--ale_linters/javascript/xo.vim8
2 files changed, 4 insertions, 33 deletions
diff --git a/ale_linters/javascript/standard.vim b/ale_linters/javascript/standard.vim
index ab5ef5a7..15e6d78f 100644
--- a/ale_linters/javascript/standard.vim
+++ b/ale_linters/javascript/standard.vim
@@ -17,35 +17,10 @@ function! ale_linters#javascript#standard#GetCommand(buffer) abort
\ . ' --stdin %s'
endfunction
-function! ale_linters#javascript#standard#Handle(buffer, lines) abort
- " Matches patterns line the following:
- "
- " /path/to/some-filename.js:47:14: Strings must use singlequote.
- " /path/to/some-filename.js:56:41: Expected indentation of 2 spaces but found 4.
- " /path/to/some-filename.js:13:3: Parsing error: Unexpected token
- let l:pattern = '^.*:\(\d\+\):\(\d\+\): \(.\+\)$'
- let l:output = []
-
- for l:match in ale#util#GetMatches(a:lines, l:pattern)
- let l:type = 'Error'
- let l:text = l:match[3]
-
- call add(l:output, {
- \ 'bufnr': a:buffer,
- \ 'lnum': l:match[1] + 0,
- \ 'col': l:match[2] + 0,
- \ 'text': l:text,
- \ 'type': 'E',
- \})
- endfor
-
- return l:output
-endfunction
-
+" standard uses eslint and the output format is the same
call ale#linter#Define('javascript', {
\ 'name': 'standard',
\ 'executable_callback': 'ale_linters#javascript#standard#GetExecutable',
\ 'command_callback': 'ale_linters#javascript#standard#GetCommand',
-\ 'callback': 'ale_linters#javascript#standard#Handle',
+\ 'callback': 'ale#handlers#eslint#Handle',
\})
-
diff --git a/ale_linters/javascript/xo.vim b/ale_linters/javascript/xo.vim
index 648e0d14..cf305eb4 100644
--- a/ale_linters/javascript/xo.vim
+++ b/ale_linters/javascript/xo.vim
@@ -17,14 +17,10 @@ function! ale_linters#javascript#xo#GetCommand(buffer) abort
\ . ' --reporter unix --stdin --stdin-filename %s'
endfunction
-function! ale_linters#javascript#xo#Handle(buffer, lines) abort
- " xo uses eslint and the output format is the same
- return ale_linters#javascript#eslint#Handle(a:buffer, a:lines)
-endfunction
-
+" xo uses eslint and the output format is the same
call ale#linter#Define('javascript', {
\ 'name': 'xo',
\ 'executable_callback': 'ale_linters#javascript#xo#GetExecutable',
\ 'command_callback': 'ale_linters#javascript#xo#GetCommand',
-\ 'callback': 'ale_linters#javascript#xo#Handle',
+\ 'callback': 'ale#handlers#eslint#Handle',
\})