developit / developit/unfetch

Typescript issue: weird dependency on node-fetch in declaration file

未关闭
#96 9 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看
typescript
主要语言
JavaScript
星标
5.7k
派生
204
PR 合并指标
30 天内没有已合并 PR

描述

First of all thanks for awesome polyfill @developit. It's brilliant and altogether with preact it makes a perfect match for our product bundle!

As for this issue I'm not sure why there's a dependency on node-fetch in declaration file. When I try to use unfetch in my TS code I get this:

```
ERROR in [at-loader] ./node_modules/unfetch/src/index.d.ts:6:8
TS7016: Could not find a declaration file for module 'node-fetch'. '/Users/dsorin/.../node_modules/node-fetch/index.js' implicitly has an 'any' type.
Try `npm install @types/node-fetch` if it exists or add a new declaration (.d.ts) file containing `declare module 'node-fetch';`
```

I know this can be fixed by installing typings for node-fetch but this leads to a further questions like "what's this typing doing in our dependencies if we don't use node-fetch package? let's remove it".

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。