I'm upgrading a project from Angular JS to Angular 4. TypeScript is already used in the Angular JS project, and after converting it I'm getting thousands of errors in Visual Studio for 3rd party typescript typing files (*.d.ts). I'm also getting a few errors in Visual Studio on the actual TypeScript files.
The TypeScript code compiles successfully when I use the command line TypeScript compiler (tsc), so I want to prevent compile checking of all *.d.ts files.
I've reviewed answers for very similar problems that suggest how to ignore these errors however none on them work for me, and most of them relate to VS 2017.
Here's what I've tried, to disable compile checking:
Added 'TypeScriptCompileBlocked' to .csproj file:
<PropertyGroup>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
....
</PropertyGroup>
- then close and re-open VS
Added .eslintignore file
I've added an .eslintignore file to the project root, with a setting to ignore all *.d.ts files:
**/*.d.ts
**/node_modules/*
Disable ESLint
Under VS Tools > Options, I've looked for an option, but there is no option to do this in VS2015
tsconfig.json - exclude node_modules folder
"exclude": [
"./node_modules/*"
]
-- I've also tried --
"node_modules"
... and
"**/*.d.ts"
tsconfig.json - set "compileOnSave": false
{
"compilerOptions": {
"compileOnSave": false
}
}
also I've added the following to "compilerOptions":
"types": []
I've also set various other compilerOptions to ignore errors, although the errors I'm seeing aren't related to these:
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"noStrictGenericChecks": true
What do I have to do to ignore the *.d.ts files? Here's a sample of some of the errors I'm seeing in the file node_modules\@angular\common\src\directives\ng_class.d.ts:
The current project configuration is:
- compiler (tsc) version = 1.8
- TypeScript version = 2.6.2 (installed via npm)
- There are no TypeScript configuration options set directly through the Visual Studio project (i.e. in the .csproj file)
My full tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "ES2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"noStrictGenericChecks": true
},
"include": [ "**/*.ts" ],
"exclude": [
"node_modules"
]
}
(in regard to the value I'm using for module, here's what the MicroSoft documentation says):
"ES6" and "ES2015" values may be used when targeting "ES5" or lower.
https://www.typescriptlang.org/docs/handbook/compiler-options.html
I've also tried using "commonjs" as the value


.eslintignorewill not help withtscompile errors.tsconfig.ignoreshould help. I had this working at one point, after encountering the same issue, but that was 2 years ago and I no longer have VS 2015 installed. Assuming that you are using the latest TypeScript (2.6.2), and that you have the latest installation of TS for VS 2015. Let me know if that is the case and I may be able to provide an answer."compilerOptions": {"types": []}}Please add an example of some of the specific errors to this question to help confirm.