ale/ale_linters/sugarss/stylelint.vim
Nicolas Blanchot 32e6fc5975
Stylelint linter output stream can go to stderr (#4702)
Since [version 13.6.0](804bb24c75/CHANGELOG.md (L654)),
following [PR 4799](https://github.com/stylelint/stylelint/pull/4799)
`stylelint` errors are sent to `stderr`. Previous versions where sending
errors to `stdout`.
2024-01-14 20:43:31 +09:00

23 lines
847 B
VimL

" 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',
\ 'output_stream': 'both',
\ 'executable': {b -> ale#path#FindExecutable(b, 'sugarss_stylelint', [
\ 'node_modules/.bin/stylelint',
\ ])},
\ 'command': function('ale_linters#sugarss#stylelint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
\})