Issue 1:
If you know how to fix the issue, make a pull request instead.

I tried using the @types/sinon#5.0.7 package and had problems. (5.0.7 is latest)

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

Mention the authors (see Definitions by: in index.d.ts) so they can respond. (sorry for including everyone!)

Authors: @MrBigDog2U, @rationull, @lumaxis, @nicojs, @43081j, @JoshuaKGoldberg, @gjednaszewski, @johnjesse

I recently installed the latest @types/sinon package (version 5.0.7) and found a number of breaking changes compared to the 5.0.1 package. Resulting in a number of spec file errors. These sorts of errors were very unexpected due the version changing being only a "patch", but resulted in 100+ linting errors.

Most of these seem to be related to the changes made to the sinon.SinonSandbox type. For example, this code used to be fine in 5.0.1

import * as sinon from 'sinon';
// describe
let sandbox: sinon.SinonSandbox;
beforeEach(() => {
sandbox = sinon.createSanbox();
});
// spec file
sandbox
.stub(AppModel.prototype as any, 'create')
.returns(Promise.resolve({}));
// class file
AppModel {
private create(): AppResponse {
//...
}
}

But after 5.0.7 installation I'd get errors on the given code such as:

test/models/app-model.spec.ts(59,7): error TS2349: Cannot invoke an expression
whose type lacks a call signature.
Type '((obj: any) => SinonStub<any[], any>) | ((obj: {}) => SinonStub<unknown[], {}>)'
has no compatible call signatures.

I was able to "quick-fix" this issue by changing the spec file code to:

(sandbox as any)
.stub(AppModel.prototype as any, 'create')
.returns(Promise.resolve({}));

But this sort of solution was not optimal since I was essentially making sinon's sandbox an any type just to fix issues with my "stubbing". This issue really caught me off guard since it was introduced within a "patch" change.

There were a number of other unwanted changes that all resulted in a number of linting errors.

Issue 2:
If you know how to fix the issue, make a pull request instead.

I tried using the @types/sinon package and had problems.

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

Mention the authors (see Definitions by: in index.d.ts) so they can respond.

Authors: @johnjesse @PranavSenthilnathan

With the delivery of #30442, which resulted in @type/sinon version 5.0.6 being published, my builds stopped working.

I get multiple errors such as this:

node_modules/@types/sinon/index.d.ts:41:20 - error TS2370: A rest parameter must be of an array type.

41 calledWith(...args: TArgs): boolean;
~~~~~~~~~~~~~~
node_modules/@types/sinon/index.d.ts:45:27 - error TS2370: A rest parameter must be of an array type.

45 calledWithExactly(...args: TArgs): boolean;
~~~~~~~~~~~~~~

If this library is not backward compatible with TypeScript 2.9.x, shouldn't it be published as version 6 instead of 5.0.x ?

I don't know much about Typescript, but my builds are failing, my developers are 12 hours away and my investigation got me here. If I misunderstood the Types and the way they are versioned, please let me know and close this issue.

Thank.