Closed
Description
lib.dom.ts defines Node.parentElement as never-null:
https://github.com/Microsoft/TypeScript/blob/95c3eccbe9f3f7e1857ce157d437e6b80b3c9c6f/lib/lib.dom.d.ts#L8749
However, it's a pretty common pattern to write loops like
while (n.parentElement != null) {
// [...]
n = n.parentElement;
}
to walk up the node tree.
Also parentNode, previousSibling, nextSibling, firstChild, lastChild... (?)