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