It seems like TypeScript is heavily influenced by Microsoft's interpretation of the DOM and JavaScript. But what if I'm not concerned with Internet Explorer and Edge? Unfortunately, I'm encountering issues with TypeScript...
For instance, when using Element.getBoundingClientRect()
, it returns an object with x
and y
properties in most browsers, except for IE and Edge (refer to notes here).
When attempting to compile code where I use this method, such as I encounter a compilation error stating
TS2339: Property 'x' does not exist on type 'ClientRect | DOMRect'.
Is there a way to convince the compiler to overlook these issues?