title: Overriding default jsdoc -> .d.ts conversion to get rid of ...args: any[]
body: <p>When using <code>tsc</code> to generate declarations only, JSDoc tags are used to infer types etc.</p>
  <p>Is it possible to override the types inferred from the JSDoc?</p>
  <p>Specifically, for a function using <code>arguments</code>, <a href="https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#var-args-parameter-declaration-inferred-from-use-of-arguments" rel="nofollow noreferrer">tsc will always add</a> an <code>...args: any[]</code> vararg parameter to the function declaration. I want to override that to get rid of it since <code>arguments</code> is only used for legacy reasons and there should be no vararg arguments to the function.</p>
  <p>Example:</p>
  <pre><code>/**
   * @param {number} x
   */
  function myLegacyFunction(x) {
    if (arguments.length &gt; 1) {
      throw new Error();
    }
    return 42;
  }
  </code></pre>
  <p>... will render</p>
  <pre><code>export function myLegacyFunction(x: number, ...args: any[]): number;
  </code></pre>
  <p>Note that even if I do use <code>@param</code> to document <code>x</code> and leave out <code>args</code>, it's still added implicitly.
  I also tried explicitly listing <code>args</code> as type <code>...never</code>, but that also didn't help:</p>
  <pre><code>/**
   * @param {number} x
   * @param {...never} args
   */
  function myLegacyFunction(x) {
    if (arguments.length &gt; 1) {
      throw new Error();
    }
    return 42;
  }
  </code></pre>
  <p>How can I make <code>tsc</code> understand that this function should simply be:</p>
  <pre><code>export function myLegacyFunction(x: number): number;
  </code></pre>
  <p>(Using typescript 4.2.3.)</p>