Commit 5443048
committed
In
Unlike a couple commits back, where I removed something because we want
to avoid others copying it, here we end up *needing* to add it because
there is not presently a story for how to handle `@types` declarations
which are in the position `console-ui` is currently:
- The consuming app/library is using `Node16` resolution, but does not
have `"type": "module"` set, so TS interprets any unspecified module
as being CJS.
- The `@types` package itself depends on *another* package which is set
to operate as ESM. Here, `console-ui`'s types point to `inquirer`'s
types, which are set as ESM.
In this situation, the direct dependency gets interpreted as CJS, and
this produces an error, because it is CJS using `import` statements and
TS complains that since it will be run as `require()` in CJS, you
should switch to using dynamic import. But: it's a `.d.ts` file! We
*cannot* use dynamic import there!
Net, there is no current workaround for this that I have found; I have
raised it in the TS Discord, and we will want to come up with a better
solution (in this case: probably just by converting `console-ui` to
publish a dual-package mode package *and* publish its own types). And
in the meantime... we will ship this with `skipLibCheck`. :sigh:ts, introduce skipLibCheck (and sob)1 parent 80f239f commit 5443048
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
0 commit comments