Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js nestsjs中的模块和类型没有未使用的var eslint_Node.js_Eslint_Nestjs_Tslint - Fatal编程技术网

Node.js nestsjs中的模块和类型没有未使用的var eslint

Node.js nestsjs中的模块和类型没有未使用的var eslint,node.js,eslint,nestjs,tslint,Node.js,Eslint,Nestjs,Tslint,我已经将eslint添加到我的NestJS7项目中,并对未使用的vars错误感到困惑 我在模块、生命周期方法和服务方面出错。 也有类型错误 import { Controller, Get } from '@nestjs/common'; import { HealthCheck, HealthCheckService, ---> got here the the error MongooseHealthIndicator, ---> got here the the

我已经将eslint添加到我的NestJS7项目中,并对未使用的vars错误感到困惑

我在模块、生命周期方法和服务方面出错。 也有类型错误

import { Controller, Get } from '@nestjs/common';
import {
  HealthCheck,
  HealthCheckService,  ---> got here the the error
  MongooseHealthIndicator, ---> got here the  the error
} from '@nestjs/terminus';

@Controller('health')
export class HealthController {
  constructor(
    private health: HealthCheckService,
    private mongoose: MongooseHealthIndicator
  ) {}

  @Get()
  @HealthCheck()
  check() {
    return this.health.check([() => this.mongoose.pingCheck('mongoose')]);
  }
}

elintrc.js配置:

module.exports = {
    parser: '@typescript-eslint/parser',
    plugins: ['@typescript-eslint'],
    extends: [
        "eslint:recommended",
        "plugin:@typescript-eslint/eslint-recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:prettier/recommended",
        "prettier/@typescript-eslint",
    ],
    env: {
        "browser": true,
        "es6": true,
        "node": true
    },
    overrides: [
        {
            "files": ["*.js"],
            "rules": {
                "@typescript-eslint/no-var-requires": "off"
            }
        }
    ]
}

我相信这来自于。目前唯一的解决办法是不使用该特定规则