Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When using Ky with Node, TypeScript will run into compilation error regarding types required by `UndiciRequestInit`. This is because `@types/node` does not yet provide these types, and they are not imported from `undici-types` either. The latter would not even be possible to keep Ky usable with browsers. This happened to work in the project, because `@sindresorhus/tsconfig` includes `DOM` in the libs section. In most Node applications, the DOM lib should not be there and clashes with Node types. One way to circumvent this is to add `skipLibCheck: true` to `tsconfig.json`, but this is not a good solution. This commit adds the needed types until `@types/node` imports the missing types and adds them to globals. After that, all "Undici" types from the request types should be removed.
- Loading branch information