mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'eslint',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'executable_callback': 'ale#handlers#eslint#GetExecutable',
|
||||
\ 'command_callback': 'ale#handlers#eslint#GetCommand',
|
||||
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#eslint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||
\})
|
||||
|
@ -54,7 +54,8 @@ function! ale_linters#javascript#flow#GetCommand(buffer, version_lines) abort
|
||||
return ale#Escape(l:executable)
|
||||
\ . ' check-contents'
|
||||
\ . (l:use_respect_pragma ? ' --respect-pragma': '')
|
||||
\ . ' --json --from ale %s'
|
||||
\ . ' --json --from ale %s < %t'
|
||||
\ . (!has('win32') ? '; echo' : '')
|
||||
endfunction
|
||||
|
||||
" Filter lines of flow output until we find the first line where the JSON
|
||||
@ -155,7 +156,8 @@ function! ale_linters#javascript#flow#Handle(buffer, lines) abort
|
||||
\}
|
||||
|
||||
if has_key(l:error, 'extra')
|
||||
let l:errorToAdd.detail = s:GetDetails(l:error)
|
||||
let l:errorToAdd.detail = l:errorToAdd.text
|
||||
\ . "\n" . s:GetDetails(l:error)
|
||||
endif
|
||||
|
||||
call add(l:output, l:errorToAdd)
|
||||
@ -166,11 +168,11 @@ endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'flow',
|
||||
\ 'executable_callback': 'ale_linters#javascript#flow#GetExecutable',
|
||||
\ 'executable': function('ale_linters#javascript#flow#GetExecutable'),
|
||||
\ 'command_chain': [
|
||||
\ {'callback': 'ale_linters#javascript#flow#VersionCheck'},
|
||||
\ {'callback': 'ale_linters#javascript#flow#GetCommand'},
|
||||
\ ],
|
||||
\ 'callback': 'ale_linters#javascript#flow#Handle',
|
||||
\ 'add_newline': !has('win32'),
|
||||
\ 'read_buffer': 0,
|
||||
\})
|
||||
|
@ -19,10 +19,10 @@ endfunction
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'flow-language-server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_flow_ls', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_flow_ls', [
|
||||
\ 'node_modules/.bin/flow',
|
||||
\ ]),
|
||||
\ ])},
|
||||
\ 'command': '%e lsp --from ale-lsp',
|
||||
\ 'project_root_callback': 'ale_linters#javascript#flow_ls#FindProjectRoot',
|
||||
\ 'project_root': function('ale_linters#javascript#flow_ls#FindProjectRoot'),
|
||||
\ 'language': 'javascript',
|
||||
\})
|
||||
|
@ -53,9 +53,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'jscs',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jscs', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_jscs', [
|
||||
\ 'node_modules/.bin/jscs',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#javascript#jscs#GetCommand',
|
||||
\ ])},
|
||||
\ 'command': function('ale_linters#javascript#jscs#GetCommand'),
|
||||
\ 'callback': 'ale_linters#javascript#jscs#Handle',
|
||||
\})
|
||||
|
@ -25,9 +25,9 @@ endfunction
|
||||
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'jshint',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_jshint', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_jshint', [
|
||||
\ 'node_modules/.bin/jshint',
|
||||
\ ]),
|
||||
\ 'command_callback': 'ale_linters#javascript#jshint#GetCommand',
|
||||
\ ])},
|
||||
\ 'command': function('ale_linters#javascript#jshint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
||||
|
@ -24,7 +24,7 @@ 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',
|
||||
\ 'executable': function('ale_linters#javascript#standard#GetExecutable'),
|
||||
\ 'command': function('ale_linters#javascript#standard#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||
\})
|
||||
|
@ -8,10 +8,10 @@ call ale#Set('javascript_tsserver_use_global', get(g:, 'ale_use_global_executabl
|
||||
call ale#linter#Define('javascript', {
|
||||
\ 'name': 'tsserver',
|
||||
\ 'lsp': 'tsserver',
|
||||
\ 'executable_callback': ale#node#FindExecutableFunc('javascript_tsserver', [
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'javascript_tsserver', [
|
||||
\ 'node_modules/.bin/tsserver',
|
||||
\ ]),
|
||||
\ ])},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root_callback': {-> ''},
|
||||
\ 'project_root': function('ale#handlers#tsserver#GetProjectRoot'),
|
||||
\ 'language': '',
|
||||
\})
|
||||
|
@ -20,7 +20,7 @@ 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',
|
||||
\ 'executable': function('ale_linters#javascript#xo#GetExecutable'),
|
||||
\ 'command': function('ale_linters#javascript#xo#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#eslint#Handle',
|
||||
\})
|
||||
|
Reference in New Issue
Block a user