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

Limit no-customized-built-in-elements to built ins #39

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

mbullington
Copy link
Contributor

Description

This PR changes no-customized-built-in-elements to only error if the extended class is a value of builtInTagMap (except HTMLElement, of course).

          node.superClass &&
          node.superClass.name !== 'HTMLElement' &&
          Object.values(builtInTagMap).includes(node.superClass.name)

The main motivation behind this work is extending a class that itself extends HTMLElement, without the complexity of static analyzing.

Alternatives

Alternatively to this PR, users could just turn this rule off, but would lose slight benefit.

We could also have an allowlist for this rule, allowedSuperNames, similar to #38

Breaking changes

This may change the actual (not expected) behavior of no-customized-built-in-elements in slight ways

…gMap

This may change the actual (not expected) behavior of no-customized-built-in-elements in slight ways
Copy link
Member

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @koddsson thoughts?

Copy link
Contributor

@koddsson koddsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! Looks great to me 👍🏻

@koddsson koddsson merged commit 7bed82c into github:main Feb 11, 2022
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