mattpocock / ts-error-translator

VSCode extension to turn TypeScript errors into plain English
https://ts-error-translator.vercel.app
2.36k stars 91 forks source link

Translation request for 2312 #198

Closed rdebeasi closed 1 year ago

rdebeasi commented 1 year ago

Error Text

An interface can only extend an object type or intersection of object types with statically known members.

Supporting Information

I have code that looks like this:

export interface MyTableCellProps extends ComponentPropsWithoutRef<'td' | 'th'> {

When I upgraded to the React 18 types, I got the error text above. Reading through this Stack Overflow thread, it sounds like I could resolve this problem by either:

Here's my attempt at a plain-English description of this error:

An interface can't extend a union. Consider using a type alias instead.

Is that description accurate? If so, I'd be happy to contribute that update! If not, I'd love to hear what could be better.

Thank you so much for your time!