<p dir="auto">I am incorrectly getting the following error, <strong>"This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6"</strong>.</p>
<p dir="auto">Furthermore, I think I may have stumbled upon a weird case where if the start of the file name is "temp" as in "temp.js", "temporary.js", or "temp123.js" it will cause this error.</p>
<p dir="auto">To reproduce:<br>
Create a file called temp.js with some ES6 code, such as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let x = 10"><pre class="notranslate"><code class="notranslate">let x = 10
</code></pre></div>
<p dir="auto">The above error is now showing. To fix it, create the jsconfig.json file which sets the target to ES6:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;compilerOptions&quot;: {
        &quot;target&quot;: &quot;ES6&quot;
    }
}"><pre class="notranslate"><code class="notranslate">{
    "compilerOptions": {
        "target": "ES6"
    }
}
</code></pre></div>
<p dir="auto">The error is still showing, now incorrectly.</p>
<p dir="auto">If I rename "temp.js" to "test.js" (or anything that doesn't start with 'temp') the error goes away. Or, if I create a files array in jsconfig.json which lists "temp.js", the error goes away:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;compilerOptions&quot;: {
        &quot;target&quot;: &quot;ES6&quot;
    },
    &quot;files&quot;: [
        &quot;temp.js&quot;
    ]
}"><pre class="notranslate"><code class="notranslate">{
    "compilerOptions": {
        "target": "ES6"
    },
    "files": [
        "temp.js"
    ]
}
</code></pre></div>
<p dir="auto">I don't want to have to do this for every file in my project.</p>
<p dir="auto">I'm running on Windows 7, 64-bit.</p>
<p dir="auto">Thanks</p>
<p dir="auto">Hi.</p>
<p dir="auto">Thanks for your product, I really enjoy using it. However I have one problem:<br>
When using ES6 features, like the arrow functions, I get the message "This can only be used with ES6. Make sure to have a jsconfig.json-file which sets the target to ES6".</p>
<p dir="auto">However I have a <code class="notranslate">jsconfig.json</code>-file in my root (the folder opened in Visual Studio Code), which contains:</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;ES6&quot;,
        &quot;module&quot;: &quot;commonjs&quot;
    }
}"><pre class="notranslate">{
    <span class="pl-ent">"compilerOptions"</span>: {
        <span class="pl-ent">"target"</span>: <span class="pl-s"><span class="pl-pds">"</span>ES6<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"module"</span>: <span class="pl-s"><span class="pl-pds">"</span>commonjs<span class="pl-pds">"</span></span>
    }
}</pre></div>
<p dir="auto">The weird part is that I get it for some files, and not for others. Even if the files are in the same directory. Right now I have three files in the subdirectory <code class="notranslate">/app/bpm</code> names <code class="notranslate">bpm.js</code>, <code class="notranslate">bpmController.js</code> and <code class="notranslate">enterClick.js</code>. All three are written with ES6-functionality, but I only get the warning and red underlined text for <code class="notranslate">bpm.js</code>.</p>
<p dir="auto">UPDATE:<br>
I just restarted VS Code, and the red underline disappeared from <code class="notranslate">bpm.js</code> too. It was a new file I had created after the two others, however the red underline only went away after a restart.</p>