summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvindex10 <vindex10@gmail.com>2023-02-02 06:13:52 +0100
committerGitHub <noreply@github.com>2023-02-02 14:13:52 +0900
commit98f466f9ce851edeb99fa14a75fca1f266f62d52 (patch)
tree87e0f11e3a70ddd3bff53651fa4c6dd83f7e8989
parent599f7b1eda20d48cf0a68c543b9e8d31266010eb (diff)
downloadale-98f466f9ce851edeb99fa14a75fca1f266f62d52.zip
add eslint plugin html for linting js in html files (#4428)
* add eslint plugin html for linting js in html files * fix linting
-rw-r--r--ale_linters/html/eslint.vim12
-rw-r--r--doc/ale-supported-languages-and-tools.txt1
-rw-r--r--supported-tools.md1
3 files changed, 14 insertions, 0 deletions
diff --git a/ale_linters/html/eslint.vim b/ale_linters/html/eslint.vim
new file mode 100644
index 00000000..699f5301
--- /dev/null
+++ b/ale_linters/html/eslint.vim
@@ -0,0 +1,12 @@
+" Author: Victor Ananyev <vindex10@gmail.com>
+" Description: eslint for js snippets in HTML files
+
+
+call ale#linter#Define('html', {
+\ '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/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt
index 71b9c12d..fea2fd85 100644
--- a/doc/ale-supported-languages-and-tools.txt
+++ b/doc/ale-supported-languages-and-tools.txt
@@ -255,6 +255,7 @@ Notes:
* `alex`
* `angular`
* `cspell`
+ * `eslint`
* `fecs`
* `html-beautify`
* `htmlhint`
diff --git a/supported-tools.md b/supported-tools.md
index 348efe2e..45280e56 100644
--- a/supported-tools.md
+++ b/supported-tools.md
@@ -264,6 +264,7 @@ formatting.
* [alex](https://github.com/get-alex/alex)
* [angular](https://www.npmjs.com/package/@angular/language-server)
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
+ * [eslint](https://github.com/BenoitZugmeyer/eslint-plugin-html)
* [fecs](http://fecs.baidu.com/)
* [html-beautify](https://beautifier.io/)
* [htmlhint](http://htmlhint.com/)