Skip to content

Instantly share code, notes, and snippets.

@Artur-
Created September 6, 2018 11:36
Show Gist options
  • Save Artur-/12c49be24638589e6613b6527f690183 to your computer and use it in GitHub Desktop.
Save Artur-/12c49be24638589e6613b6527f690183 to your computer and use it in GitHub Desktop.
Finds missing import statements for custom elements
findMissingImports = (element) => {
if (element.tagName.indexOf('-') != -1 && !customElements.get(element.tagName.toLowerCase())) {
console.error("Element "+element.tagName+" is not upgraded");
}
Array.from(element.children).forEach(e => findMissingImports(e));
if (element.shadowRoot) {
Array.from(element.shadowRoot.children).forEach(e => findMissingImports(e));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment