Closed jcfranco closed 8 months ago
What does this produce as a result of what is reserved? It should match https://www.w3schools.com/tags/ref_attributes.asp all of these different types of HTML components attribute are reserved if you use something like a web component in svelte
It should warn against property/method names that match global attributes and properties found on HTMLElement
(see https://github.com/stencil-community/stencil-eslint/issues/100#issuecomment-1845846998 for additional context).
This change will reduce the currently erroring names, this would break backwards compatibility for other users and ads I’ve stated in the linked issue we should actually be expanding this list to match all reserved html attributes of all elements.
The rule's documentation specifies it targets reserved global HTML attribute names for props and methods. My PR addresses false positives for non-global attributes like color, aligning with the rule's intent. Framework-specific quirks are outside the rule's scope.
I can side with that but people already using the linter rule will now no longer have a guard so it would be a breaking change that should come with another option to replace what is being removed.
I don't agree it being a breaking change from the documentation perspective. The current behavior, which flags additional, unrelated properties, should be considered a bug.
In any case, could you provide a snippet or example use case along with the error/warning? I'm unfamiliar with Svelte and really trying to understand the issue. I don't get why Svelte would complain about the attribute/prop name of a 3rd-party custom element.
@raphaelpor Are there any additional steps needed from me to get this landed? This PR was approved a while back and I'm eager to help it progress. Thanks!
@raphaelpor Thanks for the merge! 🚀
Related issue: #100
This PR aims to make the check for reserved member names more robust by creating list of reserved attributes/props from a local custom element (
HTMLElement
instance).Additional changes
jsdom
,@types/jsdom
and@types/node
packages to allow usage ofHTMLElement
from a Node context.