<p dir="auto">I have the following ES6 class</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyClass {
    constructor(){
        this.myclassvar = 'abc';
    }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">MyClass</span> <span class="pl-kos">{</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">myclassvar</span> <span class="pl-c1">=</span> <span class="pl-s">'abc'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">When compiled/transpiled through TypeScript it generates error TS2339: Property 'myclassvar' does not exist on type 'MyClass'.</p>
<p dir="auto">If the above code snippet is valid ES6 then TypeScript should not generate the error. The generated javascript it valid. It's just that the error scares the developers trying to use ES6 without typings.</p>
<p dir="auto">The same ES6 class transpiles properly in BabelJS.</p>
<p dir="auto">I know I can fix the error by declaring the variable.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyClass {
    myclassvar;
    constructor(){
        this.myclassvar = 'abc';
    }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">MyClass</span> <span class="pl-kos">{</span>
    <span class="pl-c1">myclassvar</span><span class="pl-kos">;</span>
    <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
        <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">myclassvar</span> <span class="pl-c1">=</span> <span class="pl-s">'abc'</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Since TypeScript is a superset of Javascript, it should be able to handle valid ES6 without errors.</p>
<p dir="auto">My compiler settings are</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;compilerOptions&quot;: {
        &quot;target&quot;: &quot;es5&quot;,
        &quot;module&quot;: &quot;amd&quot;,
        &quot;declaration&quot;: true,
        &quot;noImplicitAny&quot;: false,
        &quot;noResolve&quot;: true,
        &quot;removeComments&quot;: true,
        &quot;noLib&quot;: false,
        &quot;emitDecoratorMetadata&quot;: true,
        &quot;experimentalDecorators&quot;: true
    }"><pre class="notranslate"><span class="pl-ent">"compilerOptions"</span>: {
        <span class="pl-ent">"target"</span>: <span class="pl-s"><span class="pl-pds">"</span>es5<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"module"</span>: <span class="pl-s"><span class="pl-pds">"</span>amd<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"declaration"</span>: <span class="pl-c1">true</span>,
        <span class="pl-ent">"noImplicitAny"</span>: <span class="pl-c1">false</span>,
        <span class="pl-ent">"noResolve"</span>: <span class="pl-c1">true</span>,
        <span class="pl-ent">"removeComments"</span>: <span class="pl-c1">true</span>,
        <span class="pl-ent">"noLib"</span>: <span class="pl-c1">false</span>,
        <span class="pl-ent">"emitDecoratorMetadata"</span>: <span class="pl-c1">true</span>,
        <span class="pl-ent">"experimentalDecorators"</span>: <span class="pl-c1">true</span>
    }</pre></div>
<p dir="auto">Currently <code class="notranslate">import myClass from './myClass.ts';</code> transpile to <code class="notranslate">var myClass_ts_1 = require('./myClass.ts')'</code>.</p>
<p dir="auto">Since <code class="notranslate">myClass.ts</code> is transpile to <code class="notranslate">myClass.js</code>, the transpiled code does not work.</p>
<p dir="auto">I try to stick to pure ES6 as much as possible so I want to avoid using internal module syntax.</p>
<p dir="auto">Thanks!</p>