Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.24 KB

no-customized-built-in-elements.md

File metadata and controls

39 lines (28 loc) · 1.24 KB

Disallows extending of built-in elements (no-customized-built-in-elements)

Custom Elements can extend from any available element, for example HTMLParagraphElement.

There are a few reasons for why you would want to only extend from HTMLElement.

Rule Details

This rule restricts Custom Elements to only extend from HTMLElement.

👎 Examples of incorrect code for this rule:

class MyListElement extends HTMLUListElement {
  // ...
}

👍 Examples of correct code for this rule:

class MyListElement extends HTMLElement {
  // ...
}

When Not To Use It

If you want to extend from built-in elements, don't need to support Safari (or are happy using a polyfill) and are OK with the trade-offs, then this rule can be disabled.