X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0ee596c5c5e11fc79598407eaf22f83d279f7e9e..5a4872f466ebd76ddd532bdf2798554421c53df4:/.vim/bundle/ale/ale_linters/scss/stylelint.vim?ds=sidebyside diff --git a/.vim/bundle/ale/ale_linters/scss/stylelint.vim b/.vim/bundle/ale/ale_linters/scss/stylelint.vim new file mode 100644 index 00000000..4f82a98a --- /dev/null +++ b/.vim/bundle/ale/ale_linters/scss/stylelint.vim @@ -0,0 +1,20 @@ +" Author: diartyz + +call ale#Set('scss_stylelint_executable', 'stylelint') +call ale#Set('scss_stylelint_options', '') +call ale#Set('scss_stylelint_use_global', get(g:, 'ale_use_global_executables', 0)) + +function! ale_linters#scss#stylelint#GetCommand(buffer) abort + return '%e ' . ale#Pad(ale#Var(a:buffer, 'scss_stylelint_options')) + \ . ' --stdin-filename %s' +endfunction + +call ale#linter#Define('scss', { +\ 'name': 'stylelint', +\ 'output_stream': 'both', +\ 'executable': {b -> ale#path#FindExecutable(b, 'scss_stylelint', [ +\ 'node_modules/.bin/stylelint', +\ ])}, +\ 'command': function('ale_linters#scss#stylelint#GetCommand'), +\ 'callback': 'ale#handlers#css#HandleStyleLintFormat', +\})