<p dir="auto">I am using Visual Studio 2015 Update 1 and Typescript for VS2015 1.8.4.<br>
I have a project that contains TypeScript files.<br>
Here's my <code class="notranslate">tsconfig.json</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;compileOnSave&quot;: true,
  &quot;compilerOptions&quot;: {
    &quot;target&quot;: &quot;es5&quot;,
    &quot;module&quot;: &quot;system&quot;,
    &quot;moduleResolution&quot;: &quot;node&quot;,
    &quot;sourceMap&quot;: true,
    &quot;emitDecoratorMetadata&quot;: true,
    &quot;experimentalDecorators&quot;: true,
    &quot;removeComments&quot;: false,
    &quot;noImplicitAny&quot;: false,
    &quot;noEmitOnError&quot;: true
  },
  &quot;exclude&quot;: [
    &quot;node_modules&quot;,
    &quot;typings&quot;
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "noEmitOnError": true
  },
  "exclude": [
    "node_modules",
    "typings"
  ]
}
</code></pre></div>
<p dir="auto">When I write incorrect TypeScript, let's say i have <code class="notranslate">file1.ts</code> and write <code class="notranslate">foo</code> , I obtain the error message<br>
<code class="notranslate">Cannot find name 'foo'</code></p>
<p dir="auto">If I try to build the project, it will result in a build failure. When the <code class="notranslate">file1.ts</code> file is correct, it generates the <code class="notranslate">file.js</code> file next to it and I can build successfully. So far so good.</p>
<p dir="auto">Now, if I change once again <code class="notranslate">file1.ts</code> , it will show <code class="notranslate">Cannot find name 'foo'</code> in the error list but building the project succeeds.</p>
<p dir="auto">What I expect is for the project build to fail.</p>
<p dir="auto">The project build will fail again when I remove the generated <code class="notranslate">file1.js</code> file.</p>
<p dir="auto">Shouldn't the TypeScript compiler try to recompile all the *.ts files that are newer than their output when I perform a build, or have the <code class="notranslate">compileOnSave</code> option to remove the output?</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.2</p>
<p dir="auto">When building a Visual Studio solution using a tsconfig.json file, the CompileTypeScriptWithTSConfig task reports "Skipping target "CompileTypeScriptWithTSConfig" because all output files are up-to-date with respect to the input files.", even though I have indeed modified my .ts files since the last build. I see this behavior both building from the command line and from within the IDE. If I select "Rebuild Solution" from within the IDE, the files get compiled correctly. Also, if I remove the tsconfig.json file (thus using the properties in the .csproj file), the files also get compiled correctly.</p>
<p dir="auto">FWIW, I would actually prefer to use the .csproj file rather than a tsconfig.json file, but as it stands now I cannot specify certain options (such as --noImplicitReturns and --noFallthroughCasesInSwitch) in the .csproj file.</p>