简体   繁体   中英

Angular 2 - Receiving TSLint errors in my node_modules folder

I just installed this angular2-material-datepicker using NPM. It's installed in my node_modules folder, however I receive tslint errors which I shouldn't be getting.

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

However in my tsconfig.json I clearly state that my node_modules folder should be excluded.

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

I confirmed that the module is located in my node_module folder. This is the first module which gives me these errors.

Any idea for possible solutions?

thanks!

I found out the issue was with webpack.

I had to exclude node_modules over there aswell.

So in /config/base.js I excluded it from the rules like this.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM