summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorJoão Pesce <jpesce@gmail.com>2021-08-20 22:02:56 -0300
committerGitHub <noreply@github.com>2021-08-21 10:02:56 +0900
commitf896744feec260fb196d38bba23308080c04192c (patch)
tree49c40ea65ab3aca714289fdf9c09681241e97012 /ale_linters
parenta099fe24b2e898c93c0aa4391e5a5631932684a6 (diff)
downloadale-f896744feec260fb196d38bba23308080c04192c.zip
Close #3872 - Add eslint-plugin-jsonc as a linter for JSON, JSONC and JSON5 (#3873)
* Add eslint as linter for JSON, JSONC and JSON5 Use the same lint configuration as eslint for javascript. * Add documentation for JSON* eslint support * Fix spacing in documentation * Update docs to be unopinionated about plugins Remove any preference for eslint plugins, since there are more thant one that would work * Reorder languages and tools in alphabetic order * Fix misalignment * Change orders to pass the tests
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/json/eslint.vim16
-rw-r--r--ale_linters/json5/eslint.vim16
-rw-r--r--ale_linters/jsonc/eslint.vim16
3 files changed, 48 insertions, 0 deletions
diff --git a/ale_linters/json/eslint.vim b/ale_linters/json/eslint.vim
new file mode 100644
index 00000000..bdabb9fa
--- /dev/null
+++ b/ale_linters/json/eslint.vim
@@ -0,0 +1,16 @@
+" Author: João Pesce <joao@pesce.cc>
+" Description: eslint for JSON files.
+"
+" Requires eslint-plugin-jsonc or a similar plugin to work
+"
+" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
+" <devw0rp@gmail.com>
+
+call ale#linter#Define('json', {
+\ 'name': 'eslint',
+\ 'output_stream': 'both',
+\ 'executable': function('ale#handlers#eslint#GetExecutable'),
+\ 'cwd': function('ale#handlers#eslint#GetCwd'),
+\ 'command': function('ale#handlers#eslint#GetCommand'),
+\ 'callback': 'ale#handlers#eslint#HandleJSON',
+\})
diff --git a/ale_linters/json5/eslint.vim b/ale_linters/json5/eslint.vim
new file mode 100644
index 00000000..6207f2d7
--- /dev/null
+++ b/ale_linters/json5/eslint.vim
@@ -0,0 +1,16 @@
+" Author: João Pesce <joao@pesce.cc>
+" Description: eslint for JSON5 files.
+"
+" Requires eslint-plugin-jsonc or a similar plugin to work
+"
+" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
+" <devw0rp@gmail.com>
+
+call ale#linter#Define('json5', {
+\ 'name': 'eslint',
+\ 'output_stream': 'both',
+\ 'executable': function('ale#handlers#eslint#GetExecutable'),
+\ 'cwd': function('ale#handlers#eslint#GetCwd'),
+\ 'command': function('ale#handlers#eslint#GetCommand'),
+\ 'callback': 'ale#handlers#eslint#HandleJSON',
+\})
diff --git a/ale_linters/jsonc/eslint.vim b/ale_linters/jsonc/eslint.vim
new file mode 100644
index 00000000..1a5cc528
--- /dev/null
+++ b/ale_linters/jsonc/eslint.vim
@@ -0,0 +1,16 @@
+" Author: João Pesce <joao@pesce.cc>
+" Description: eslint for JSONC files.
+"
+" Requires eslint-plugin-jsonc or a similar plugin to work
+"
+" Uses the same funtcions as ale_linters/javascript/eslint.vim by w0rp
+" <devw0rp@gmail.com>
+
+call ale#linter#Define('jsonc', {
+\ 'name': 'eslint',
+\ 'output_stream': 'both',
+\ 'executable': function('ale#handlers#eslint#GetExecutable'),
+\ 'cwd': function('ale#handlers#eslint#GetCwd'),
+\ 'command': function('ale#handlers#eslint#GetCommand'),
+\ 'callback': 'ale#handlers#eslint#HandleJSON',
+\})