mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -4,6 +4,28 @@
|
||||
call ale#Set('handlebars_embertemplatelint_executable', 'ember-template-lint')
|
||||
call ale#Set('handlebars_embertemplatelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
|
||||
return ale#node#FindExecutable(a:buffer, 'handlebars_embertemplatelint', [
|
||||
\ 'node_modules/.bin/ember-template-lint',
|
||||
\])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
|
||||
" Reading from stdin was introduced in ember-template-lint@1.6.0
|
||||
return ale#semver#GTE(a:version, [1, 6, 0])
|
||||
\ ? '%e --json --filename %s'
|
||||
\ : '%e --json %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ ale_linters#handlebars#embertemplatelint#GetExecutable(a:buffer),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#handlebars#embertemplatelint#GetCommand'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:json = ale#util#FuzzyJSONDecode(a:lines, {})
|
||||
@ -30,10 +52,9 @@ function! ale_linters#handlebars#embertemplatelint#Handle(buffer, lines) abort
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('handlebars', {
|
||||
\ 'name': 'ember-template-lint',
|
||||
\ 'executable': {b -> ale#node#FindExecutable(b, 'handlebars_embertemplatelint', [
|
||||
\ 'node_modules/.bin/ember-template-lint',
|
||||
\ ])},
|
||||
\ 'command': '%e --json %t',
|
||||
\ 'name': 'embertemplatelint',
|
||||
\ 'aliases': ['ember-template-lint'],
|
||||
\ 'executable': function('ale_linters#handlebars#embertemplatelint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck'),
|
||||
\ 'callback': 'ale_linters#handlebars#embertemplatelint#Handle',
|
||||
\})
|
||||
|
Reference in New Issue
Block a user