diff --git a/lib/health-indicator/microservice/grpc.health.ts b/lib/health-indicator/microservice/grpc.health.ts index eadb9579b..8d85f4a90 100644 --- a/lib/health-indicator/microservice/grpc.health.ts +++ b/lib/health-indicator/microservice/grpc.health.ts @@ -128,9 +128,14 @@ export class GRPCHealthIndicator extends HealthIndicator { private createClient( options: CheckGRPCServiceOptions, ): NestJSMicroservices.ClientGrpc { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { timeout, healthServiceName, healthServiceCheck, ...grpcOptions } = - options; + const { + // Remove the options which are not needed for the client + timeout: _t, + healthServiceName: _hS, + healthServiceCheck: _hSC, + + ...grpcOptions + } = options; return this.nestJsMicroservices.ClientProxyFactory.create({ transport: 4, options: grpcOptions as any, diff --git a/package-lock.json b/package-lock.json index 9a9fc993e..18cac9ab0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,6 +51,7 @@ "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jest": "^27.2.3", + "eslint-plugin-unused-imports": "^3.0.0", "fastify": "4.23.2", "gulp": "4.0.2", "gulp-clean": "0.4.0", @@ -7909,6 +7910,36 @@ } } }, + "node_modules/eslint-plugin-unused-imports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.0.0.tgz", + "integrity": "sha512-sduiswLJfZHeeBJ+MQaG+xYzSWdRXoSw61DpU13mzWumCkR0ufD0HmO4kdNokjrkluMHpj/7PJeN35pgbhW3kw==", + "dev": true, + "dependencies": { + "eslint-rule-composer": "^0.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^6.0.0", + "eslint": "^8.0.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + } + } + }, + "node_modules/eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", + "dev": true, + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -27029,6 +27060,21 @@ "@typescript-eslint/utils": "^5.10.0" } }, + "eslint-plugin-unused-imports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-3.0.0.tgz", + "integrity": "sha512-sduiswLJfZHeeBJ+MQaG+xYzSWdRXoSw61DpU13mzWumCkR0ufD0HmO4kdNokjrkluMHpj/7PJeN35pgbhW3kw==", + "dev": true, + "requires": { + "eslint-rule-composer": "^0.3.0" + } + }, + "eslint-rule-composer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz", + "integrity": "sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==", + "dev": true + }, "eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", diff --git a/package.json b/package.json index c0fa593f4..c134fd6ce 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "eslint-plugin-deprecation": "^2.0.0", "eslint-plugin-import": "^2.27.5", "eslint-plugin-jest": "^27.2.3", + "eslint-plugin-unused-imports": "^3.0.0", "fastify": "4.23.2", "gulp": "4.0.2", "gulp-clean": "0.4.0", @@ -257,7 +258,8 @@ "sourceType": "module" }, "plugins": [ - "@typescript-eslint/eslint-plugin" + "@typescript-eslint/eslint-plugin", + "unused-imports" ], "extends": [ "plugin:deprecation/recommended", @@ -313,10 +315,15 @@ "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/prefer-optional-chain": 1, - "@typescript-eslint/no-unused-vars": [ - 1, + "@typescript-eslint/no-unused-vars": "off", + "unused-imports/no-unused-imports": "error", + "unused-imports/no-unused-vars": [ + "warn", { - "varsIgnorePattern": "^_" + "vars": "all", + "varsIgnorePattern": "^_", + "args": "after-used", + "argsIgnorePattern": "^_" } ], "@typescript-eslint/consistent-type-imports": [