Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property '_doesIntervalAllowAnother' implicitly has type 'any' #89

Closed
ChristianBoehlke opened this issue Nov 11, 2019 · 4 comments
Closed

Comments

@ChristianBoehlke
Copy link

Hello,

Thank you for the great work with this library! We tried upgrading from version 6.2.0 to 6.2.1 and are getting the following TypeScript compiler errors:

node_modules/p-queue/dist/index.d.ts:28:17 - error TS7033: Property '_doesIntervalAllowAnother' implicitly has type 'any', because its get accessor lacks a return type annotation.

28     private get _doesIntervalAllowAnother();
                   ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/p-queue/dist/index.d.ts:29:17 - error TS7033: Property '_doesConcurrentAllowAnother' implicitly has type 'any', because its get accessor lacks a return type annotation.

29     private get _doesConcurrentAllowAnother();
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~

We are using TypeScript 3.6.4 and have noImplicitAny: true set.

The type definitions for version 6.2.0 declared them as private variables:

private readonly _doesIntervalAllowAnother;
private readonly _doesConcurrentAllowAnother;

The type definitions for version 6.2.1 now declare them as private getters:

private get _doesIntervalAllowAnother();
private get _doesConcurrentAllowAnother();

Maybe that's why TypeScript treats them differently?

Thank you for you help!

@sindresorhus
Copy link
Owner

Looks like it was fixed in TS 3.7.2, but I think you have to upgrade to that version: microsoft/TypeScript@e48cd3a

@georgyfarniev
Copy link

@sindresorhus I cannot upgrade to latest typescript, since it will break many things in my monorepo (nuxt, vue, etc have some issues). How about adding explicit type annotations please?

@sindresorhus
Copy link
Owner

It does have a type annotation:

private get _doesIntervalAllowAnother(): boolean {
The problem is explained in the linked commit. Not much I can do to work around it. I suggest you just pin the p-queue version to 6.2.0 until you can upgrade TypeScript.

@sindresorhus
Copy link
Owner

More discussion about it here: microsoft/TypeScript#35016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants