<p dir="auto">If you know how to fix the issue, make a pull request instead.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/sinon#5.0.7</code> package and had problems. (5.0.7 is latest)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>.  (Please ask any appropriate questions there).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond. (sorry for including everyone!)
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/MrBigDog2U/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/MrBigDog2U">@MrBigDog2U</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/rationull/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/rationull">@rationull</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lumaxis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lumaxis">@lumaxis</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nicojs/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nicojs">@nicojs</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/43081j/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/43081j">@43081j</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/JoshuaKGoldberg/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/JoshuaKGoldberg">@JoshuaKGoldberg</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gjednaszewski/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gjednaszewski">@gjednaszewski</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/johnjesse/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/johnjesse">@johnjesse</a></li>
</ul>
</li>
</ul>
<hr>
<p dir="auto">I recently installed the latest @types/sinon package (version 5.0.7) and found a number of <strong>breaking changes</strong> 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.</p>
<p dir="auto">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</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as sinon from 'sinon';
// describe
let sandbox: sinon.SinonSandbox;
beforeEach(() =&gt; {
  sandbox = sinon.createSanbox();
});
// spec file
sandbox
  .stub(AppModel.prototype as any, 'create')
  .returns(Promise.resolve({}));
// class file
AppModel {
  private create(): AppResponse  {
    //...
  }
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">sinon</span> <span class="pl-k">from</span> <span class="pl-s">'sinon'</span><span class="pl-kos">;</span>
<span class="pl-c">// describe</span>
<span class="pl-k">let</span> <span class="pl-s1">sandbox</span>: <span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-smi">SinonSandbox</span><span class="pl-kos">;</span>
<span class="pl-en">beforeEach</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-s1">sandbox</span> <span class="pl-c1">=</span> <span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-en">createSanbox</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// spec file</span>
<span class="pl-s1">sandbox</span>
  <span class="pl-kos">.</span><span class="pl-en">stub</span><span class="pl-kos">(</span><span class="pl-smi">AppModel</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-k">as</span> <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s">'create'</span><span class="pl-kos">)</span>
  <span class="pl-kos">.</span><span class="pl-en">returns</span><span class="pl-kos">(</span><span class="pl-smi">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// class file</span>
<span class="pl-smi">AppModel</span><span class="pl-kos"></span> <span class="pl-kos">{</span>
  <span class="pl-k">private</span> <span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">AppResponse</span>  <span class="pl-kos">{</span>
    <span class="pl-c">//...</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">But after 5.0.7 installation I'd get errors on the given code such as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test/models/app-model.spec.ts(59,7): error TS2349: Cannot invoke an expression 
whose type lacks a call signature. 
Type '((obj: any) =&gt; SinonStub&lt;any[], any&gt;) | ((obj: {}) =&gt; SinonStub&lt;unknown[], {}&gt;)' 
has no compatible call signatures."><pre class="notranslate"><code class="notranslate">test/models/app-model.spec.ts(59,7): error TS2349: Cannot invoke an expression 
whose type lacks a call signature. 
Type '((obj: any) =&gt; SinonStub&lt;any[], any&gt;) | ((obj: {}) =&gt; SinonStub&lt;unknown[], {}&gt;)' 
has no compatible call signatures.
</code></pre></div>
<p dir="auto">I was able to "quick-fix" this issue by changing the spec file code to:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="(sandbox as any)
  .stub(AppModel.prototype as any, 'create')
  .returns(Promise.resolve({}));"><pre class="notranslate"><span class="pl-kos">(</span><span class="pl-s1">sandbox</span> <span class="pl-k">as</span> <span class="pl-smi">any</span><span class="pl-kos">)</span>
  <span class="pl-kos">.</span><span class="pl-en">stub</span><span class="pl-kos">(</span><span class="pl-smi">AppModel</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-k">as</span> <span class="pl-smi">any</span><span class="pl-kos">,</span> <span class="pl-s">'create'</span><span class="pl-kos">)</span>
  <span class="pl-kos">.</span><span class="pl-en">returns</span><span class="pl-kos">(</span><span class="pl-smi">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">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.</p>
<p dir="auto">There were a number of other unwanted changes that all resulted in a number of linting errors.</p>
<p dir="auto">If you know how to fix the issue, make a pull request instead.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/sinon</code> package and had problems.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>.  (Please ask any appropriate questions there).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond.
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/johnjesse/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/johnjesse">@johnjesse</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/PranavSenthilnathan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/PranavSenthilnathan">@PranavSenthilnathan</a></li>
</ul>
</li>
</ul>
<p dir="auto">With the delivery of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="379479076" data-permission-text="Title is private" data-url="https://github.com/DefinitelyTyped/DefinitelyTyped/issues/30442" data-hovercard-type="pull_request" data-hovercard-url="/DefinitelyTyped/DefinitelyTyped/pull/30442/hovercard" href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/30442">#30442</a>, which resulted in <code class="notranslate">@type/sinon</code> version 5.0.6 being published, my builds stopped working.</p>
<p dir="auto">I get multiple errors such as this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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;
                             ~~~~~~~~~~~~~~"><pre class="notranslate"><code class="notranslate">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;
                             ~~~~~~~~~~~~~~
</code></pre></div>
<p dir="auto">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 ?</p>
<p dir="auto">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.</p>
<p dir="auto">Thank.</p>