Chore: Add issue/pr template and general housekeeping tools and docs (#900)
* Add linting * Add issue templates and docs * Add root eslint config and remove tslint * Autofix lint issues
This commit is contained in:
@@ -226,7 +226,7 @@ export function buildFromNode(
|
||||
}
|
||||
break;
|
||||
case NodeType.DOCUMENT_TYPE_NODE:
|
||||
const documentType = (node as Node) as DocumentType;
|
||||
const documentType = (node ) as DocumentType;
|
||||
rrNode = rrdom.createDocumentType(
|
||||
documentType.name,
|
||||
documentType.publicId,
|
||||
@@ -234,7 +234,7 @@ export function buildFromNode(
|
||||
);
|
||||
break;
|
||||
case NodeType.ELEMENT_NODE:
|
||||
const elementNode = (node as Node) as HTMLElement;
|
||||
const elementNode = (node ) as HTMLElement;
|
||||
const tagName = getValidTagName(elementNode);
|
||||
rrNode = rrdom.createElement(tagName);
|
||||
const rrElement = rrNode as IRRElement;
|
||||
@@ -249,14 +249,14 @@ export function buildFromNode(
|
||||
*/
|
||||
break;
|
||||
case NodeType.TEXT_NODE:
|
||||
rrNode = rrdom.createTextNode(((node as Node) as Text).textContent || '');
|
||||
rrNode = rrdom.createTextNode(((node ) as Text).textContent || '');
|
||||
break;
|
||||
case NodeType.CDATA_SECTION_NODE:
|
||||
rrNode = rrdom.createCDATASection(((node as Node) as CDATASection).data);
|
||||
rrNode = rrdom.createCDATASection(((node ) as CDATASection).data);
|
||||
break;
|
||||
case NodeType.COMMENT_NODE:
|
||||
rrNode = rrdom.createComment(
|
||||
((node as Node) as Comment).textContent || '',
|
||||
((node ) as Comment).textContent || '',
|
||||
);
|
||||
break;
|
||||
// if node is a shadow root
|
||||
@@ -316,9 +316,9 @@ export function buildFromDom(
|
||||
// if the node is a shadow dom
|
||||
if (
|
||||
node.nodeType === NodeType.ELEMENT_NODE &&
|
||||
((node as Node) as HTMLElement).shadowRoot
|
||||
((node ) as HTMLElement).shadowRoot
|
||||
)
|
||||
walk(((node as Node) as HTMLElement).shadowRoot!, rrNode);
|
||||
walk(((node ) as HTMLElement).shadowRoot!, rrNode);
|
||||
node.childNodes.forEach((childNode) => walk(childNode, rrNode));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user