Skip to content

Feature request: require custom elements be registered on HTMLElementTagNameMap #73

@rictic

Description

@rictic

A pass that would diagnose when a custom element is recognized in source code but it hasn't be declared on the HTMLElementTagNameMap, or if it is declared with the wrong tag name. For example:

Warns:

import {customElement, LitElement} from 'lit-element';
@customElement('foo-bar')
class FooBar extends LitElement {}
//    ~~~~~~  warning!

Warns:

import {customElement, LitElement} from 'lit-element';
@customElement('foo-bar')
class FooBar extends LitElement {}

declare global {
  interface HTMLElementTagNameMap {
    'fizz-buzz': FooBar;
//  ~~~~~~~~~~~ warning!
  }
}

Does not warn:

import {customElement, LitElement} from 'lit-element';
@customElement('foo-bar')
class FooBar extends LitElement {}

declare global {
  interface HTMLElementTagNameMap {
    'foo-bar': FooBar;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions