microsoft / dtslint

A utility built on TSLint for linting TypeScript declaration (.d.ts) files.
MIT License
925 stars 86 forks source link

Typescript@next Errors when finding Promise #313

Closed wheresrhys closed 3 years ago

wheresrhys commented 4 years ago

On this line https://github.com/wheresrhys/fetch-mock/blob/master/types/fetch-mock-tests.ts#L200 I get the following error.

Error: /Users/wheresrhys/Projects/fetch-mock/types/fetch-mock-tests.ts:200:1
ERROR: 200:1  expect  TypeScript@next compile error:
Type 'PromiseConstructor' is not assignable to type 'new (executor: (resolve: () => void, reject: () => void) => void) => Promise<Response>'.
  Types of parameters 'executor' and 'executor' are incompatible.
    Types of parameters 'resolve' and 'resolve' are incompatible.
      Type '(value: Response | PromiseLike<Response>) => void' is not assignable to type '() => void'.

    at /Users/wheresrhys/Projects/fetch-mock/node_modules/dtslint/bin/index.js:191:19
    at Generator.next (<anonymous>)
    at fulfilled (/Users/wheresrhys/Projects/fetch-mock/node_modules/dtslint/bin/index.js:6:58)

I'm not really au fait with typescript (I only have the type defs due to demand from users of the library), so have no idea where to start debugging, and not sure if it's a mistake in the defs or a genuine bug

orta commented 3 years ago

This was likely a "bad" build of TypeScript on master, I wouldn't worry about it (he says ~6 months later) 💯