title: TypeError: Class constructor Client cannot be invoked without 'new'
body: <p>I'm working on a discord bot framework that uses ts-node (in script mode), typescript, and discord.js. When testing the core client class I got this error:</p>
  <pre><code>
  C:\Users\thedi\Documents\coding\JS-TS\discord-bot\src\struct\Client.ts:13
          super()
          ^
  TypeError: Class constructor Client cannot be invoked without 'new'
      at new DigsClient (C:\Users\thedi\Documents\coding\JS-TS\discord-bot\src\struct\Client.ts:13:9)
      at Object.&lt;anonymous&gt; (C:\Users\thedi\Documents\coding\JS-TS\discord-bot\test\index.ts:6:16)
      at Module._compile (internal/modules/cjs/loader.js:1063:30)
      at Module.m._compile (C:\Users\thedi\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1056:23)
      at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
      at Object.require.extensions.&lt;computed&gt; [as .ts] (C:\Users\thedi\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1059:12)
      at Module.load (internal/modules/cjs/loader.js:928:32)
      at Function.Module._load (internal/modules/cjs/loader.js:769:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
      at main (C:\Users\thedi\AppData\Roaming\npm\node_modules\ts-node\src\bin.ts:198:14)
  </code></pre>
  <p>There are many answers to this same question around StackOverflow, and most suggested setting the 'target' value in your tsconfig to 'es6' or higher. My problem is that the solution doesn't work for me.</p>
  <p>Here's my code:</p>
  <pre class="lang-js prettyprint-override"><code>// src/struct/Client.ts
  
  import { Client, ClientOptions, Snowflake } from 'discord.js';
  import * as discord from 'discord.js';
  
  interface DigsClientOptions {
      ownerID?: Snowflake | Array&lt;Snowflake&gt;;
  }
  
  class DigsClient extends Client {
      public constructor(
          options?: DigsClientOptions,
          discordOptions?: ClientOptions
      ) {
          super();
  
          this.ownerID = options.ownerID;
  
          return this;
      }
  
      ownerID: Snowflake | Array&lt;Snowflake&gt;;
  }
  
  export { DigsClient, DigsClientOptions };
  
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>// test/index.ts
  
  import { DigsClient } from '../src/index';
  import { config } from 'dotenv';
  config();
  const token = process.env.TOKEN;
  
  const client = new DigsClient({ ownerID: '585813838490894346' });
  
  client.login(token);
  
  </code></pre>
  <pre class="lang-json prettyprint-override"><code>//.tsconfig.json
  
  {
      &quot;compilerOptions&quot;: {
          &quot;target&quot;: &quot;es6&quot;,
          &quot;module&quot;: &quot;es6&quot;
      },
      &quot;exclude&quot;: [&quot;node_modules&quot;]
  }
  
  
  </code></pre>
  <p>This error occurs when using <code>ts-node</code> and <code>ts-node-script</code>, and I know it detects the tsconfig as I don't get errors for using es6 modules.</p>
  <p>Hope anyone can help!</p>