Angular 2-在我的node_modules文件夹中接收tslint错误



i刚刚使用npm安装了此Angular2-Material-DatePicker。它已安装在我的node_modules文件夹中,但是我收到我不应该得到的tslint错误。

ERROR in ./~/angular2-material-datepicker/index.ts
[1, 15]: ' should be "

但是,在我的tsconfig.json中,我清楚地说我的node_modules文件夹应排除。

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [ "es2016", "dom" ],
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "suppressImplicitAnyIndexErrors": true,
    "skipLibCheck": true
  },
  "include": [
    "client/**/*"
  ],
  "exclude": [ "node_modules", "dist" ]
}

我确认该模块位于我的node_module文件夹中。这是第一个给我这些错误的模块。

对可能的解决方案有任何想法吗?

谢谢!

我发现问题是WebPack。

我必须在那儿排除 node_modules

所以在/config/base.js中,我将其排除在这样的规则之外。

    module: {
        rules: [
          {
              enforce: 'pre',
              test: /.ts$/,
              loader: 'tslint-loader',
              options: {
                  emitErrors: true,
                  failOnHint: true
              },
              exclude: /node_modules/
          },

最新更新