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

When eslint-plugin-html is extended, rules from other plugins don't work. #176

Closed
ddubrava opened this issue Apr 2, 2022 · 4 comments
Closed

Comments

@ddubrava
Copy link

ddubrava commented Apr 2, 2022

Description

When eslint-plugin-html is extended, rules from other plugins don't work.

Initially, I ran into a problem in an angular project where the sharable config (it used this plugin) was breaking the extended recommended rules. So I started to find out, simplifying the code, removing deps, and came to the most simple reproduction with a single config file.

There are README files:
Minimum reproduction: https://github.com/ddubrava/eslint-plugin-html-repro
Angular project reproduction: https://github.com/ddubrava/eslint-config-tinkoff-html-issue

Setup configuration

  • ESLint version: "^8.12.0"
  • eslint-plugin-html version: "^6.2.0"
  • NodeJS version: v16.13.2
  • Operating System name and version: Windows 10 Pro (21H1)
  • ESLint configuration (.eslintrc):
{
  "root": true,
  "plugins": ["@html-eslint", "html"],
  "parser": "@html-eslint/parser",
  "extends": ["plugin:@html-eslint/recommended"]
}
@BenoitZugmeyer
Copy link
Owner

You should not use both @html-eslint/* and eslint-plugin-html. Use only one or the other.

@ddubrava
Copy link
Author

Why can't I use both of them? eslint-plugin-html is designed to lint inline scripts, while @html-eslint/* to lint HTML markup.
The problem is not in the @html-eslint/* package, the problem is that I can't use any other rules or plugins with eslint-plugin-html. That's why there is a repro with an Angular project. Where I'm just trying to use this plugin and angular recommended rules for HTML.

Thank you for your response!

@BenoitZugmeyer
Copy link
Owner

Ah! I thought @html-eslint goal was similar to eslint-plugin-html. Sorry!

I see what's going on: my plugin takes precedence and keeps only the JavaScript from HTML files. Since you don't have any in your minimal example, the @html-eslint plugin fails to detect any issue.

I have a POC to fix this issue, but still need some work.

@BenoitZugmeyer
Copy link
Owner

Fixed in v7.1.0! Thank you for your patience. Let me know how it works for you.

Markiewic added a commit to Angular-RU/angular-ru-sdk that referenced this issue Feb 24, 2023
eslint-plugin-html disables the rest of the rules
applied to html files. this issue has been fixed in:
BenoitZugmeyer/eslint-plugin-html#176
Markiewic added a commit to Angular-RU/angular-ru-sdk that referenced this issue Feb 24, 2023
eslint-plugin-html disables the rest of the rules
applied to html files. this issue has been fixed in:
BenoitZugmeyer/eslint-plugin-html#176
Markiewic added a commit to Angular-RU/angular-ru-sdk that referenced this issue Feb 24, 2023
eslint-plugin-html disables the rest of the rules
applied to html files. this issue has been fixed in:
BenoitZugmeyer/eslint-plugin-html#176

fixup! fix(eslint-config-enterprise): update eslint-plugin-html

Revert "fix(eslint-config-enterprise): update eslint-plugin-html"

This reverts commit d7b0343.

Revert "fixup! fix(eslint-config-enterprise): update eslint-plugin-html"

This reverts commit 0ad1ca1.
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