feat: no-custom-classname adding @html-eslint/parser and alpinejs syntax support #395
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat: no-custom-classname adding @html-eslint/parser support
Description
Currently,
@angular-eslint/template-parser
is recommended for HTML parsing, but it is not compatible with rules or plugins built on@html-eslint/parser
, due to limitations discussed in:eslint/eslint#18808
yeonjuan/html-eslint#211
This makes it difficult to use Tailwind-related ESLint rules in projects that use AlpineJS, since Alpine syntax (e.g. :class, x-cloak, x-transition) causes many false-positive errors.
Example from AlpineJS+Tailwind code (this one):
This PR introduces a generic
@html-eslint/parser-based
visitor that:This change is non-breaking — existing usage with
@angular-eslint/template-parser
remains fully supported.I plan to update other rules in the plugin to support
@html-eslint/parser
after initial feedback on this PR.Thanks!
Type of change
How Has This Been Tested?
Added tests using @html-eslint/parser with alpinejs and without
Test Configuration:
Checklist: