-
Notifications
You must be signed in to change notification settings - Fork 12
Add option allowedSuperNames for extends-correct-class
#38
Conversation
extends-correct-class
extends-correct-class
extends-correct-class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this change looks great! Some small nits:
lib/rules/extends-correct-class.js
Outdated
allowedSuperNames = [builtInTagMap[extendsTag]] | ||
} else { | ||
allowedSuperNames = [...((context.options[0] || {}).allowedSuperNames || [])] | ||
// Make sure to treat this like a set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we'd like to treat this like a Set, does it make sense to just make it a Set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changing it to a Set
also works!
To stringify with the changes, would we need to convert back to an array?
Never mind tried this out, also works with an iterable! I made the change, thanks for the speedy reviews.
This works great! I'll pull down and update the unit tests. Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me! @koddsson for a second set of eyes on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks for this ❤️
Closes #32
Description
This adds an option
allowedSuperNames
to theextends-correct-class
rule that an Autonomous custom element may extend. It is assumed that by using this option, any allowed super name must extendHTMLElement
in its prototype chain.