Skip to content
This repository was archived by the owner on Sep 18, 2023. It is now read-only.

Allow for HTML elements of the structure VendorHTMLElement #37

Closed
wants to merge 1 commit into from

Conversation

mbullington
Copy link
Contributor

Description

This PR just changes the regex to detect elements of the form ^.*HTML.*Element$. The motivation for this is custom element base classes, such as VendorHTMLElement.

Breaking changes

ESLint rule may be more lenient than before and highlight new warnings.

ESLint plugin may be more lenient than before, and highlight new issues.
@mbullington mbullington changed the title fix: 🎨 Allow for HTML elements of the structure VendorHTMLElement Allow for HTML elements of the structure VendorHTMLElement Feb 8, 2022
@keithamus
Copy link
Contributor

I discussed this with @koddsson. We think this needs to change a little. We think this would be best suited as an option. Rather than broadening the RegExp, rules which use these RegExps should be able to pass in the desired superclass, so for e.g. if you're using a library and need to extend from VendorHTMLElement, you can explicitly put VendorHTMLELement as the superclass for the applicable rules.

@mbullington
Copy link
Contributor Author

mbullington commented Mar 1, 2022

I discussed this with @koddsson. We think this needs to change a little. We think this would be best suited as an option. Rather than broadening the RegExp, rules which use these RegExps should be able to pass in the desired superclass, so for e.g. if you're using a library and need to extend from VendorHTMLElement, you can explicitly put VendorHTMLELement as the superclass for the applicable rules.

Thanks for the discussion! Does ESLint have a global way to assign options for multiple rules, say similar to the allowlist in #38 but on a plugin-wide level?

Otherwise, I worry that it may be tedious to specify a superclass for each rule.

This is also the last change I had made in our fork of eslint-plugin-custom-elements, but I'm not super opinionated on it. Do you think HTMLVendorElement would make more sense? If so, I'm happy to make those changes so we can move upstream.

@silverwind
Copy link
Contributor

Does ESLint have a global way to assign options for multiple rules

That's what settings is for, but keep note that this is legacy eslint config format, it might be different for the flat config format.

@keithamus
Copy link
Contributor

This project has now been merged with eslint-plugin-wc. Please head there for updates and maintenance.

@keithamus keithamus closed this Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants