summaryrefslogtreecommitdiff
path: root/ale_linters/json/spectral.vim
diff options
context:
space:
mode:
authortatsuya <t2h5k0@gmail.com>2021-01-06 13:25:52 +0900
committertatsuya <t2h5k0@gmail.com>2021-01-23 11:56:10 +0900
commit66b3e768db55b0c03fa34310a5c79bbd24209694 (patch)
tree0d1301fb2bfb49ce9c1bd2de3184645583d64414 /ale_linters/json/spectral.vim
parent997dd7f8fe45030e65b418c5f46e20d808b1c5eb (diff)
downloadale-66b3e768db55b0c03fa34310a5c79bbd24209694.zip
add spectral support for json
Diffstat (limited to 'ale_linters/json/spectral.vim')
-rw-r--r--ale_linters/json/spectral.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/ale_linters/json/spectral.vim b/ale_linters/json/spectral.vim
new file mode 100644
index 00000000..c7d56234
--- /dev/null
+++ b/ale_linters/json/spectral.vim
@@ -0,0 +1,14 @@
+" Author: t2h5 <https://github.com/t2h5>
+" Description: Integration of Stoplight Spectral CLI with ALE.
+
+call ale#Set('json_spectral_executable', 'spectral')
+call ale#Set('json_spectral_use_global', get(g:, 'ale_use_global_executables', 0))
+
+call ale#linter#Define('json', {
+\ 'name': 'spectral',
+\ 'executable': {b -> ale#node#FindExecutable(b, 'json_spectral', [
+\ 'node_modules/.bin/spectral',
+\ ])},
+\ 'command': '%e lint --ignore-unknown-format -q -f text %t',
+\ 'callback': 'ale#handlers#spectral#HandleSpectralOutput'
+\})