request-promise-lite icon indicating copy to clipboard operation
request-promise-lite copied to clipboard

Typescript with noImplicitAny caused implicitly has 'any' type errors when import classes

Open haihovu opened this issue 3 years ago • 2 comments

request-promise-lite Version 0.16.0 tsconfig.json has "noImplicitAny": true

Adding this import caused the error shown below: import { ConnectionError } from 'request-promise-lite';

node_modules/request-promise-lite/types/index.d.ts:24:3 - error TS7010: 'debug', which lacks return-type annotation, implicitly has an 'any' return type.

24 debug(...tokens); ~~~~~~~~~~~~~~~~~

node_modules/request-promise-lite/types/index.d.ts:24:9 - error TS7019: Rest parameter 'tokens' implicitly has an 'any[]' type.

24 debug(...tokens); ~~~~~~~~~

haihovu avatar Jun 21 '22 15:06 haihovu

A pull request would be much appreciated, but since the advent of Node 18 and its built-in fetch support, I am planning to retire this library. Is there a use case that fetch would not serve you?

laurisvan avatar Jun 25 '22 05:06 laurisvan

I'll prepare a pull request. We're still on node 14 with plan to move to node 16 soon, 18 is nowhere on the radar.

haihovu avatar Jun 25 '22 12:06 haihovu