Visual Studio 2015 - errors in * .d.ts files in the node_modules folder

I upgrade the project from Angular JS to Angular 4. TypeScript is already used in the Angular JS project, and after converting it, I get thousands of errors in Visual Studio for the 3rd party TypeScript file input (* .d.ts). I also get several errors in Visual Studio in the actual TypeScript files.

TypeScript code compiles successfully when I use the TypeScript command line compiler (tsc), so I want to prevent compilation checks from all * .d.ts files.

I looked at answers to very similar problems that show how to ignore these errors, however, none of them work for me, and most of them relate to VS 2017.

Here I tried to disable compilation checking:

Added 'TypeScriptCompileBlocked' to the .csproj file:

   <PropertyGroup>
      <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
      ....
   </PropertyGroup>
  • VS

.eslintignore

.eslintignore , *.d.ts:

**/*.d.ts
**/node_modules/*

ESLint

" VS" > "" , VS2015

tsconfig.json - node_modules

"exclude": [
  "./node_modules/*"
]

-- I've also tried --   

   "node_modules"
   ... and
   "**/*.d.ts"

tsconfig.json - "compileOnSave": false

{
  "compilerOptions": {
    "compileOnSave": false
  }
}

"compilerOptions":

"types": []

, , , , :

"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"noStrictGenericChecks": true

, *.d.ts? , node_modules\@angular\common\src\\ng_class.d.ts:

enter image description here

:

  • (tsc) version = 1.8
  • TypeScript version = 2.6.2 ( npm)
  • TypeScript, Visual Studio (.. .csproj)

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"
  ]
}

( , , MicroSoft):

"ES6" "ES2015" "ES5" .

https://www.typescriptlang.org/docs/handbook/compiler-options.html

"commonjs"

+4
2

, npm TypeScript TypeScript (I 'node ' grunt-ts TypeScript - grunt- ts 'node TypeScript). Visual Studio node -installed TypeScript, , TypeScript 1,8, Visual Studio.

TypeScript 2.6.2 VS2015, :

https://www.microsoft.com/en-us/download/details.aspx?id=48593

C:\Program Files (x86)\Microsoft SDKs\ TypeScript\2.6, tsc.exe. .csproj

<TypeScriptToolsVersion>2.6</TypeScriptToolsVersion>

.

, tsconfig.json( > ). Visual Studio TypeScript .csproj tsconfig.json

, , VS2015 Visual Studio . Visual Studio, , , :

enter image description here

, , , d.ts, Visual Studio .

0

- ADDIN? , ...

-1

Source: https://habr.com/ru/post/1691008/


All Articles