X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/less/stylelint.vim diff --git a/.vim/bundle/ale/ale_linters/less/stylelint.vim b/.vim/bundle/ale/ale_linters/less/stylelint.vim new file mode 100644 index 00000000..9430fe9b --- /dev/null +++ b/.vim/bundle/ale/ale_linters/less/stylelint.vim @@ -0,0 +1,21 @@ +" Author: diartyz , w0rp + +call ale#Set('less_stylelint_executable', 'stylelint') +call ale#Set('less_stylelint_options', '') +call ale#Set('less_stylelint_use_global', get(g:, 'ale_use_global_executables', 0)) + +function! ale_linters#less#stylelint#GetCommand(buffer) abort + let l:options = ale#Var(a:buffer, 'less_stylelint_options') + + return '%e' . ale#Pad(l:options) . ' --stdin-filename %s' +endfunction + +call ale#linter#Define('less', { +\ 'name': 'stylelint', +\ 'output_stream': 'both', +\ 'executable': {b -> ale#path#FindExecutable(b, 'less_stylelint', [ +\ 'node_modules/.bin/stylelint', +\ ])}, +\ 'command': function('ale_linters#less#stylelint#GetCommand'), +\ 'callback': 'ale#handlers#css#HandleStyleLintFormat', +\})