visual studio中的tslint显示了node_modules的linting错误

时间:2017-12-13 16:52:13

标签: visual-studio typescript visual-studio-2017 tslint tsconfig

我正在使用Visual Studio 2017(15.5.1)并尝试让tsLint正常工作。出于某种原因,我从node_modules中的所有文件和我的任何声明(* .d.ts)文件中获得了linting错误(在visual studio错误列表(Build + intellisense)中)。我没做什么似乎解决了这个问题。我想从我的错误中排除这些文件。到处似乎都认为这是可能的,但我发现的大多数例子都没有与视觉工作室打交道,我想知道是否还有其他一些额外设置我不知道。以下是我的相关文件。

tslint.json

{
  "extends": [
    "tslint:latest",
    "tslint-config-prettier"
  ]
}

tsconfig.json

{
  "compilerOptions": {
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "noEmitHelpers": true,
    "noEmitOnError": true,
    "noImplicitAny": false,
    "allowUnusedLabels": true,
    "target": "es5",
    "sourceMap": true,
    "strictNullChecks": false,
    "removeComments": true,
    "declaration": false,
    "plugins": [ { "name": "tslint-language-service" } ],
    "lib": [
      "dom",
      "es6",
      "scripthost",
      "es5",
      "es2015",
      "es2015.promise"
    ],
    "types": [
      "angular-ui-bootstrap",
      "angular",
      "autolinker",
      "bootbox",
      "bootstrap-notify",
      "bootstrap",
      "cldrjs",
      "dragula",
      "globalize",
      "googlemaps",
      "google.analytics",
      "imagesloaded",
      "jquery.blockui",
      "jquery.bootstrap.wizard",
      "jquery",
      "jqueryui",
      "jquery.validation",
      "jsts",
      "kendo-ui",
      "masonry-layout",
      "qtip2",
      "signalr",
      "urijs",
      "moment"
    ]
  },
  "exclude": [
    "node_modules",
    "bower_components",
    "build"
  ],
  "typeRoots": [
    "node_modules/@types",
    "node_modules/moment"
  ],
  "awesomeTypescriptLoaderOptions": {
    "useBabel": true,
    "useCache": true
  },
  "compileOnSave": true,
  "buildOnSave": true 
}

0 个答案:

没有答案