-
Notifications
You must be signed in to change notification settings - Fork 12
custom-elements/extends-correct-class
should check if the parent class extends HTMLElement
#32
Comments
Hey @maicol07 thanks for the issue! I believe this would be too difficult to track properly with eslint, as tracking the inheritance chain project wide would get too complex too quickly. For example base class could sit across dependency boundaries. I would suggest inviting that much complexity into your codebase probably warrants turning this rule off. If you have some ideas around how we can avoid such complexity I'd be open to suggestions. We could perhaps add a list of allowed classes that these elements can inherit from, as an option. I'll close this issue for now, as in it's current form I don't think we can do much. If you disagree, or think there's a particular direction we should go in, I'd be happy to re-open it and investigate further. |
@keithamus the withelist option would be okay for my use case! |
Great! Would you like to work on a PR for this? |
Actually, I don't know how custom rules work 😅 However, I can look at it when I have time! |
I can try picking this up! I've noticed many other rules rely on extending |
@keithamus I ended up creating a few small PRs that include this work, but also other things I noticed when trying to use the plugin in a production environment. When you have time would be great if you could look. If the decisions I made in the PR aren't right for the project, that's totally okay. happy to work with you on this! |
Currently,
custom-elements/extends-correct-class
checks if the custom element extends HTMLElement. However, it triggers an error if the class I want to extend extendsHTMLElement
.Example:
The text was updated successfully, but these errors were encountered: