4 ms·
But how do you solve it in a tsc context? Using the default prop doesn't work in tsc and breaks all type information because tsc just doesn't know of any defau
by desmap 6y ago
But how do you solve it in a tsc context?
Using the default prop doesn't work in tsc and breaks all type information because tsc just doesn't know of any default prop.
- fireattack 6y agoNot exactly sure what you mean but you can check this: https://github.com/microsoft/TypeScript/issues/2719 https://github.com/microsoft/TypeScript/issues/2719
- desmap 6y agoThanks for the link. I meant following case: A TS file which compiles to an es6 ("esnext") module cannot import cjs. Either node breaks or TS' type-checking fails. Former if you omit default when importing and latter if you introduce .default in the TS codebase. It's a bit complicated, what I just wrote about is reflected in the chart in step 4-6 here https://github.com/microsoft/TypeScript/issues/18442#issuecomment-666190219 https://github.com/microsoft/TypeScript/issues/18442#issueco...