From 56d6f7cedfbf48f34a7850e7c8f099f7f5cf2d0c Mon Sep 17 00:00:00 2001 From: Jamie Magee Date: Thu, 3 Jun 2021 20:09:46 -0700 Subject: [PATCH] PR comments --- .eslintrc.js | 2 ++ lib/util/cache/package/decorator.spec.ts | 4 +--- lib/util/cache/package/decorator.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c2c970e27d2e4b..8dfbd0dfde506c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -123,6 +123,8 @@ module.exports = { '@typescript-eslint/unbound-method': 0, 'jest/valid-title': [0, { ignoreTypeOfDescribeName: true }], + 'max-classes-per-file': 0, + 'class-methods-use-this': 0, }, }, { diff --git a/lib/util/cache/package/decorator.spec.ts b/lib/util/cache/package/decorator.spec.ts index 6be6a72a217bf4..d4ca78a928ee14 100644 --- a/lib/util/cache/package/decorator.spec.ts +++ b/lib/util/cache/package/decorator.spec.ts @@ -1,5 +1,3 @@ -/* eslint-disable max-classes-per-file */ -/* eslint-disable class-methods-use-this */ import os from 'os'; import { mock } from 'jest-mock-extended'; import { getName } from '../../../../test/util'; @@ -40,7 +38,7 @@ describe(getName(), () => { class MyClass { @cache({ namespace: (arg: GetReleasesConfig) => arg.registryUrl, - key: 'key', + key: () => 'key', }) public async getNumber(_: GetReleasesConfig): Promise { await spy(); diff --git a/lib/util/cache/package/decorator.ts b/lib/util/cache/package/decorator.ts index c399e178dfc1b2..60fc2590c15ab0 100644 --- a/lib/util/cache/package/decorator.ts +++ b/lib/util/cache/package/decorator.ts @@ -3,10 +3,10 @@ import { logger } from '../../../logger'; import * as packageCache from '.'; type Handler = (parameters: DecoratorParameters) => Promise; -type Method = (this: T, ...args: any[]) => any; +type Method = (this: T, ...args: any[]) => Promise; type Decorator = ( target: U, - key: keyof any, + key: keyof U, descriptor: TypedPropertyDescriptor> ) => TypedPropertyDescriptor>;