From 98f466f9ce851edeb99fa14a75fca1f266f62d52 Mon Sep 17 00:00:00 2001 From: vindex10 Date: Thu, 2 Feb 2023 06:13:52 +0100 Subject: add eslint plugin html for linting js in html files (#4428) * add eslint plugin html for linting js in html files * fix linting --- ale_linters/html/eslint.vim | 12 ++++++++++++ doc/ale-supported-languages-and-tools.txt | 1 + supported-tools.md | 1 + 3 files changed, 14 insertions(+) create mode 100644 ale_linters/html/eslint.vim 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 +" 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/) -- cgit v1.2.3