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

Feature: rule to match tag-name to class #215

Open
hugo-vrijswijk opened this issue Dec 12, 2024 · 1 comment
Open

Feature: rule to match tag-name to class #215

hugo-vrijswijk opened this issue Dec 12, 2024 · 1 comment

Comments

@hugo-vrijswijk
Copy link

Similar to eslint-plugin-wc tag-name-matches-class a similar rule that matches on @customElement

Incorrect example:

@customElement("my-element")
export class FooBar extends LitElement {

Correct example:

@customElement("foo-bar")
export class FooBar extends LitElement {

Similar to the eslint-plugin-wc rule, a prefix and suffix option would be good

@43081j
Copy link
Owner

43081j commented Dec 13, 2024

Makes sense I think

Though it seems we need literally the same rule but looking at the decorator string rather than the define call

I wonder if we can somehow share the implementation. Maybe the WC plugin could somehow expose how it finds tag names so we can extend it instead of providing a separate rule

Maybe I'm overthinking though and we should just duplicate it 😅

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