Back to Top


1397/05/29 - 00:12

Stop compiling type script files in visual studio

When I was compiling visual studio code typescript files had compiled too. And because of their errors project could not compile successfully.

کلمات کلیدی

Visual Studio2017Tsconfigtypescript

Stop compiling type script files in visual studio

For solving this issue we should check these points:

1. In tsconfig we should have a syntaxt like this:

{
  "compileOnSave": true,
  "compilerOptions": {
    "moduleResolution": "node",
    "allowJs": true,
    "noImplicitAny": true,
    "removeComments": true, 
    "preserveConstEnums": true,
    "target": "es5",
    "watch": false
  }, 
  "files": [
    "wwwroot/lib/_typings/_index.d.ts",
   ...
  ]
}

2. In project config file (.csproj) we should have:

<PropertyGroup>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  </PropertyGroup>

3. In Error list of project we should set error scope on build only (Default is Build+IntelliSense)