summaryrefslogtreecommitdiff
path: root/ale_linters/sugarss/stylelint.vim
blob: 6b0adf5afffb14c965f8454fcaae95254773dce0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
" 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',
\   'executable_callback': ale#node#FindExecutableFunc('sugarss_stylelint', [
\       'node_modules/.bin/stylelint',
\   ]),
\   'command_callback': 'ale_linters#sugarss#stylelint#GetCommand',
\   'callback': 'ale#handlers#css#HandleStyleLintFormat',
\})