summaryrefslogtreecommitdiff
path: root/ale_linters/sugarss
diff options
context:
space:
mode:
authorNiclas Åhdén <niclas@instateam.io>2019-01-27 12:42:11 +0100
committerw0rp <w0rp@users.noreply.github.com>2019-01-27 11:42:11 +0000
commite46c17e8ef85c3108f93bd3f19d6f1775b2fbf63 (patch)
tree03e1c9680783c191c1d15e3be64b7e79b33e8bb5 /ale_linters/sugarss
parentf03370e1833cb200c43368eb22d930f3d76d56fc (diff)
downloadale-e46c17e8ef85c3108f93bd3f19d6f1775b2fbf63.zip
SugarSS support from PR 1967 (#2219)
* sugarss support + bonus naming Sass correctly * cleanup + alphabetic ordering
Diffstat (limited to 'ale_linters/sugarss')
-rw-r--r--ale_linters/sugarss/stylelint.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/ale_linters/sugarss/stylelint.vim b/ale_linters/sugarss/stylelint.vim
new file mode 100644
index 00000000..6b0adf5a
--- /dev/null
+++ b/ale_linters/sugarss/stylelint.vim
@@ -0,0 +1,21 @@
+" 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',
+\ 'executable_callback': ale#node#FindExecutableFunc('sugarss_stylelint', [
+\ 'node_modules/.bin/stylelint',
+\ ]),
+\ 'command_callback': 'ale_linters#sugarss#stylelint#GetCommand',
+\ 'callback': 'ale#handlers#css#HandleStyleLintFormat',
+\})