summaryrefslogtreecommitdiff
path: root/ale_linters/javascript
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-21 11:15:05 +0100
committerw0rp <devw0rp@gmail.com>2017-06-21 11:15:05 +0100
commitd2806fad600e361e5b419e528c0e999bb4ac9b7f (patch)
tree41384c00afe6657bec1e5cc9da6de8a308ccdef8 /ale_linters/javascript
parent50d952b07d30f6f47398861dbbdcab5ced54dd7f (diff)
downloadale-d2806fad600e361e5b419e528c0e999bb4ac9b7f.zip
Fix the standard and xo handlers so they call the eslint function
Diffstat (limited to 'ale_linters/javascript')
-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',
\})