2019-01-27 11:42:11 +00:00
|
|
|
" Author: toastal <toastal@protonmail.com>
|
|
|
|
" Description: `stylelint` linter for SugarSS files
|
|
|
|
|
|
|
|
call ale#Set('sugarss_stylelint_executable', 'stylelint')
|
|
|
|
call ale#Set('sugarss_stylelint_options', '')
|
|
|
|
call ale#Set('sugarss_stylelint_use_global', get(g:, 'ale_use_global_executables', 0))
|
|
|
|
|
|
|
|
function! ale_linters#sugarss#stylelint#GetCommand(buffer) abort
|
|
|
|
return '%e ' . ale#Pad(ale#Var(a:buffer, 'sugarss_stylelint_options'))
|
|
|
|
\ . ' --syntax=sugarss'
|
|
|
|
\ . ' --stdin-filename %s'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
call ale#linter#Define('sugarss', {
|
|
|
|
\ 'name': 'stylelint',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ 'executable': {b -> ale#node#FindExecutable(b, 'sugarss_stylelint', [
|
2019-01-27 11:42:11 +00:00
|
|
|
\ 'node_modules/.bin/stylelint',
|
2019-02-22 18:05:04 +00:00
|
|
|
\ ])},
|
|
|
|
\ 'command': function('ale_linters#sugarss#stylelint#GetCommand'),
|
2019-01-27 11:42:11 +00:00
|
|
|
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
|
|
|
|
\})
|