Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility issue between eslint-plugin-html and @html-eslint #293

Closed
m1rn opened this issue Sep 18, 2024 · 1 comment
Closed

Incompatibility issue between eslint-plugin-html and @html-eslint #293

m1rn opened this issue Sep 18, 2024 · 1 comment

Comments

@m1rn
Copy link

m1rn commented Sep 18, 2024

Description

According to the documentation, eslint-plugin-html should be compatible with @html-eslint. However, when I tried using both in my project, I noticed that eslint-plugin-html stops working. It seems like the issue is caused by @html-eslint/parser.

Here are the details:

  • When I use eslint-plugin-html on its own, it works perfectly fine.
  • As soon as I introduce @html-eslint and its parser, eslint-plugin-html no longer functions.

I’d like to know if this is a known issue or if there's any way to make these two plugins work together.

Thanks!

Setup configuration

  • ESLint version: 9.10.0
  • eslint-plugin-html version: 8.1.1
  • NodeJS version: 22.1.0
  • Operating System name and version:
  • ESLint configuration (.eslintrc/eslint.config.js):
import html from "eslint-plugin-html"
import PARSER_HTML from '@html-eslint/parser'

export default [
  {
    files: ["**/*.html"],
    plugins: {
      html
    },
    languageOptions: {
      parser: PARSER_HTML
    },
    rules: {
      'no-console': 2
    }
  }
]
@BenoitZugmeyer
Copy link
Owner

BenoitZugmeyer commented Sep 20, 2024

You need both the @html-eslint/parser and @html-eslint/eslint-plugin to make it work. Ex:

import html from "eslint-plugin-html"
import htmlEslint from '@html-eslint/eslint-plugin'
import PARSER_HTML from '@html-eslint/parser'

export default [
  {
    files: ["**/*.html"],
    plugins: {
      html,
      "@html-eslint": htmlEslint,
    },
    languageOptions: {
      parser: PARSER_HTML
    },
    rules: {
      'no-console': 2
    }
  }
]

See the @html-eslint default config: https://github.com/yeonjuan/html-eslint/blob/main/packages/eslint-plugin/lib/index.js#L18-L24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants