1
0
Fork 0
mirror of synced 2024-12-27 17:13:21 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/sass/sasslint.vim

29 lines
1 KiB
VimL
Raw Normal View History

2018-12-17 06:28:27 -05:00
" Author: sQVe - https://github.com/sQVe
call ale#Set('sass_sasslint_executable', 'sass-lint')
call ale#Set('sass_sasslint_options', '')
call ale#Set('sass_sasslint_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#sass#sasslint#GetExecutable(buffer) abort
2021-05-31 16:30:26 -04:00
return ale#path#FindExecutable(a:buffer, 'sass_sasslint', [
2018-12-17 06:28:27 -05:00
\ 'node_modules/sass-lint/bin/sass-lint.js',
\ 'node_modules/.bin/sass-lint',
\])
endfunction
function! ale_linters#sass#sasslint#GetCommand(buffer) abort
let l:executable = ale_linters#sass#sasslint#GetExecutable(a:buffer)
let l:options = ale#Var(a:buffer, 'sass_sasslint_options')
return ale#node#Executable(a:buffer, l:executable)
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' -v -q -f compact %t'
endfunction
call ale#linter#Define('sass', {
\ 'name': 'sasslint',
2019-03-08 06:04:56 -05:00
\ 'executable': function('ale_linters#sass#sasslint#GetExecutable'),
\ 'command': function('ale_linters#sass#sasslint#GetCommand'),
\ 'callback': 'ale#handlers#css#HandleCSSLintFormat',
\})