Description
Hello! @html-eslint/eslint-plugin defines an html language directly on the plugin, allowing to enable HTML parsing by setting
{
language: '<@html-eslint/eslint-plugin prefix>/html'
}
instead of
import eslintParserHtml from '@html-eslint/parser';
{
languageOptions: {
parser: eslintParserHtml,
},
}
However, if the method 1 is used instead of method 2 and eslint-plugin-html is added, HTML files linting stops completely.
Setup configuration
- ESLint version: 9.39.2
- eslint-plugin-html version: 8.1.4
- NodeJS version: Not relevant
- Operating System name and version: Not relevant
- ESLint configuration (.eslintrc/eslint.config.js): in the repro
Reproduction: https://stackblitz.com/edit/vitejs-vite-c35nwdjv
- Initially, method 1 is used and both plugins are added to the config. Run
pnpm test to run ESLint on index.html and observe no found errors (expected: 1:1 error '!DOCTYPE' is not in lowercase @html-eslint/lowercase)
- Comment out
html: eslintPluginJsInHtml line and run this script again. The problem will be reported now.
- Uncomment the same line again and uncomment
languageOptions section. The problem will continue to be correctly reported.
Additional context
Very quickly looking at the source code of this plugin, I'm guessing this is expected, but this problem is quite hard to debug. I wonder if it's possible to somehow work this around or at least mention in the docs that explicitly specifying the parser is necessary? At the very least, do not suppress the reports from other plugins if the parser cannot be found. Thank you!
Description
Hello!
@html-eslint/eslint-plugindefines anhtmllanguage directly on the plugin, allowing to enable HTML parsing by settinginstead of
However, if the method 1 is used instead of method 2 and
eslint-plugin-htmlis added, HTML files linting stops completely.Setup configuration
Reproduction: https://stackblitz.com/edit/vitejs-vite-c35nwdjv
pnpm testto run ESLint onindex.htmland observe no found errors (expected:1:1 error '!DOCTYPE' is not in lowercase @html-eslint/lowercase)html: eslintPluginJsInHtmlline and run this script again. The problem will be reported now.languageOptionssection. The problem will continue to be correctly reported.Additional context
Very quickly looking at the source code of this plugin, I'm guessing this is expected, but this problem is quite hard to debug. I wonder if it's possible to somehow work this around or at least mention in the docs that explicitly specifying the parser is necessary? At the very least, do not suppress the reports from other plugins if the parser cannot be found. Thank you!