From e46c1a00dc5e6ebb568ffefbdfca930ff410373a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 09:22:31 +0000 Subject: [PATCH 1/3] :arrow_up: Bump typescript-eslint from 7.16.1 to 8.0.0 Bumps [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) from 7.16.1 to 8.0.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.0.0/packages/typescript-eslint) --- updated-dependencies: - dependency-name: typescript-eslint dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 187 +++++++++++++++++++++++++++++++++++++++++----- package.json | 2 +- 2 files changed, 170 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index b7031bf..8e133ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "ts-jest": "^29.1.5", "ts-node": "^10.9.2", "typescript": "^5.5.4", - "typescript-eslint": "^7.16.1" + "typescript-eslint": "^8.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -5314,24 +5314,54 @@ } }, "node_modules/typescript-eslint": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.16.1.tgz", - "integrity": "sha512-889oE5qELj65q/tGeOSvlreNKhimitFwZqQ0o7PcWC7/lgRkAMknznsCsV8J8mZGTP/Z+cIbX8accf2DE33hrA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.0.0.tgz", + "integrity": "sha512-yQWBJutWL1PmpmDddIOl9/Mi6vZjqNCjqSGBMQ4vsc2Aiodk0SnbQQWPXbSy0HNuKCuGkw1+u4aQ2mO40TdhDQ==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "7.16.1", - "@typescript-eslint/parser": "7.16.1", - "@typescript-eslint/utils": "7.16.1" + "@typescript-eslint/eslint-plugin": "8.0.0", + "@typescript-eslint/parser": "8.0.0", + "@typescript-eslint/utils": "8.0.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.0.0.tgz", + "integrity": "sha512-STIZdwEQRXAHvNUS6ILDf5z3u95Gc8jzywunxSNqX00OooIemaaNIA0vEgynJlycL5AjabYLLrIyHd4iazyvtg==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.0.0", + "@typescript-eslint/type-utils": "8.0.0", + "@typescript-eslint/utils": "8.0.0", + "@typescript-eslint/visitor-keys": "8.0.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -5340,26 +5370,26 @@ } }, "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { - "version": "7.16.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.16.1.tgz", - "integrity": "sha512-u+1Qx86jfGQ5i4JjK33/FnawZRpsLxRnKzGE6EABZ40KxVT/vWsiZFEBBHjFOljmmV3MBYOHEKi0Jm9hbAOClA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.0.0.tgz", + "integrity": "sha512-pS1hdZ+vnrpDIxuFXYQpLTILglTjSYJ9MbetZctrUawogUsPdz31DIIRZ9+rab0LhYNTsk88w4fIzVheiTbWOQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.16.1", - "@typescript-eslint/types": "7.16.1", - "@typescript-eslint/typescript-estree": "7.16.1", - "@typescript-eslint/visitor-keys": "7.16.1", + "@typescript-eslint/scope-manager": "8.0.0", + "@typescript-eslint/types": "8.0.0", + "@typescript-eslint/typescript-estree": "8.0.0", + "@typescript-eslint/visitor-keys": "8.0.0", "debug": "^4.3.4" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.56.0" + "eslint": "^8.57.0 || ^9.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -5367,6 +5397,127 @@ } } }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.0.0.tgz", + "integrity": "sha512-V0aa9Csx/ZWWv2IPgTfY7T4agYwJyILESu/PVqFtTFz9RIS823mAze+NbnBI8xiwdX3iqeQbcTYlvB04G9wyQw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.0", + "@typescript-eslint/visitor-keys": "8.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/type-utils": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.0.0.tgz", + "integrity": "sha512-mJAFP2mZLTBwAn5WI4PMakpywfWFH5nQZezUQdSKV23Pqo6o9iShQg1hP2+0hJJXP2LnZkWPphdIq4juYYwCeg==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "8.0.0", + "@typescript-eslint/utils": "8.0.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.0.0.tgz", + "integrity": "sha512-wgdSGs9BTMWQ7ooeHtu5quddKKs5Z5dS+fHLbrQI+ID0XWJLODGMHRfhwImiHoeO2S5Wir2yXuadJN6/l4JRxw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.0.0.tgz", + "integrity": "sha512-5b97WpKMX+Y43YKi4zVcCVLtK5F98dFls3Oxui8LbnmRsseKenbbDinmvxrWegKDMmlkIq/XHuyy0UGLtpCDKg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.0", + "@typescript-eslint/visitor-keys": "8.0.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/utils": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.0.0.tgz", + "integrity": "sha512-k/oS/A/3QeGLRvOWCg6/9rATJL5rec7/5s1YmdS0ZU6LHveJyGFwBvLhSRBv6i9xaj7etmosp+l+ViN1I9Aj/Q==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.0.0", + "@typescript-eslint/types": "8.0.0", + "@typescript-eslint/typescript-estree": "8.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0" + } + }, + "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.0.0.tgz", + "integrity": "sha512-oN0K4nkHuOyF3PVMyETbpP5zp6wfyOvm7tWhTMfoqxSSsPmJIh6JNASuZDlODE8eE+0EB9uar+6+vxr9DBTYOA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "8.0.0", + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/undici-types": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", diff --git a/package.json b/package.json index 1e8c285..b585430 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@types/jest": "^29.5.12", "typescript": "^5.5.4", "ts-node": "^10.9.2", - "typescript-eslint":"^7.16.1", + "typescript-eslint":"^8.0.0", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.18.0", "eslint": "^8.0.1", From db7a122d9b633cc01cfbf724468d9a9e7970ebdc Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 7 Aug 2024 11:13:02 +0000 Subject: [PATCH 2/3] :rotating_light: Fixed issues caused by ESLint Upgrade --- lib/cache/cache.ts | 7 ++++--- lib/execution/debounce.ts | 4 ++-- lib/execution/once.ts | 4 ++-- lib/execution/retry.ts | 7 ++++--- lib/execution/throttle.ts | 4 ++-- lib/metrics/counter.ts | 6 +++--- lib/metrics/gauge.ts | 4 ++-- lib/metrics/measure.ts | 4 ++-- 8 files changed, 21 insertions(+), 19 deletions(-) diff --git a/lib/cache/cache.ts b/lib/cache/cache.ts index 897d5b2..1cf7156 100644 --- a/lib/cache/cache.ts +++ b/lib/cache/cache.ts @@ -4,7 +4,7 @@ import { InMemoryCache } from './memory.js'; import { isCacheKey, isPromiseLike } from '../util/predicates.js'; type CacheDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -51,7 +51,7 @@ export const CACHE_KEY = Symbol.for('Cache_Key'); */ export function CacheKey(position: number): CacheDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, _ctx: ClassMethodDecoratorContext Return>, ) => { @@ -97,7 +97,7 @@ export function CacheKey(position: number): CacheDecorator { */ export function Cache(config?: CacheConfig): CacheDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, _ctx: ClassMethodDecoratorContext Return>, ) => { @@ -133,6 +133,7 @@ export function Cache(config?: CacheConfig): CacheDecorator { cache.store(key, Promise.resolve(current) as Return, ttlInTargetUnit); resolve(current); }) + // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors .catch((error) => reject(error)); }) as Return; } diff --git a/lib/execution/debounce.ts b/lib/execution/debounce.ts index 0478141..773f47f 100644 --- a/lib/execution/debounce.ts +++ b/lib/execution/debounce.ts @@ -2,7 +2,7 @@ import { UnitOfTime } from '../util/types.js'; import { convertFrom } from '../util/transfomers.js'; type DebounceDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -29,7 +29,7 @@ type DebounceDecorator = ( */ export function Debounce(time: number, unit: Exclude): DebounceDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => { diff --git a/lib/execution/once.ts b/lib/execution/once.ts index fd3cd00..cdb6bf6 100644 --- a/lib/execution/once.ts +++ b/lib/execution/once.ts @@ -1,5 +1,5 @@ type OnceDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -25,7 +25,7 @@ type OnceDecorator = ( */ export function Once(force: boolean = false): OnceDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => { diff --git a/lib/execution/retry.ts b/lib/execution/retry.ts index 9c9da63..b1a654d 100644 --- a/lib/execution/retry.ts +++ b/lib/execution/retry.ts @@ -3,7 +3,7 @@ import { convertFrom } from '../util/transfomers.js'; import { UnitOfTime } from '../util/types.js'; type RetryDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -98,11 +98,11 @@ export function Retry(isRetrieable: (error: Error) => boolean, config: Partial( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, _ctx: ClassMethodDecoratorContext Return>, ) => { - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type return function (this: TThis, ...args: unknown[]): Return { const handleSyncRetries = (): unknown => { for (let attempt = 0; attempt < retries; attempt++) { @@ -149,6 +149,7 @@ export function Retry(isRetrieable: (error: Error) => boolean, config: Partial handleAsyncRetries() .then((response) => resolve(response)) + // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors .catch((error) => reject(error)), ); }) as Return; diff --git a/lib/execution/throttle.ts b/lib/execution/throttle.ts index 982bfc2..ca0531e 100644 --- a/lib/execution/throttle.ts +++ b/lib/execution/throttle.ts @@ -2,7 +2,7 @@ import { UnitOfTime } from '../util/types.js'; import { convertFrom } from '../util/transfomers.js'; type ThrottleDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -30,7 +30,7 @@ type ThrottleDecorator = ( */ export function Throttle(time: number, unit: Exclude): ThrottleDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => { diff --git a/lib/metrics/counter.ts b/lib/metrics/counter.ts index b691e67..a40111c 100644 --- a/lib/metrics/counter.ts +++ b/lib/metrics/counter.ts @@ -3,7 +3,7 @@ import { Kind } from '../util/types.js'; import { MetricBroadcaster } from './broadcaster.js'; type CounterDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -29,7 +29,7 @@ type CounterDecorator = ( */ export function CallCounter(label: string): CounterDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, _ctx: ClassMethodDecoratorContext Return>, ) => { @@ -63,7 +63,7 @@ export function CallCounter(label: string): CounterDecorator { */ export function Counter(label: string): CounterDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, _ctx: ClassMethodDecoratorContext Return>, ) => { diff --git a/lib/metrics/gauge.ts b/lib/metrics/gauge.ts index 5319a99..c2fb0fb 100644 --- a/lib/metrics/gauge.ts +++ b/lib/metrics/gauge.ts @@ -3,7 +3,7 @@ import { Kind } from '../util/types.js'; import { MetricBroadcaster } from './broadcaster.js'; type GaugeDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -29,7 +29,7 @@ type GaugeDecorator = ( */ export function Gauge(label: string): GaugeDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, _ctx: ClassMethodDecoratorContext Return>, ) => { diff --git a/lib/metrics/measure.ts b/lib/metrics/measure.ts index 09c8ea6..1028ee5 100644 --- a/lib/metrics/measure.ts +++ b/lib/metrics/measure.ts @@ -4,7 +4,7 @@ import { isBigint, isHrTimeAvailable, isPromiseLike } from '../util/predicates.j import { convertRecordedTime } from '../util/transfomers.js'; type MeasureDecorator = ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, ctx: ClassMethodDecoratorContext Return>, ) => void; @@ -31,7 +31,7 @@ type MeasureDecorator = ( */ export function Measure(label: string, unit: UnitOfTime): MeasureDecorator { return ( - // eslint-disable-next-line @typescript-eslint/ban-types + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type target: Function, _ctx: ClassMethodDecoratorContext Return>, ) => { From b39c765829d69802a7be1f5345ef6ed16230193d Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 7 Aug 2024 11:13:33 +0000 Subject: [PATCH 3/3] :rotating_light: Adding small time buffer, due to how timeouts work in JS --- __tests__/execution/retry.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__tests__/execution/retry.spec.ts b/__tests__/execution/retry.spec.ts index 3730f9b..e8b579c 100644 --- a/__tests__/execution/retry.spec.ts +++ b/__tests__/execution/retry.spec.ts @@ -183,7 +183,7 @@ describe('Retry Decorator', () => { const start = Date.now(); await expect(async () => await target.callThatCanFail()).rejects.toThrow('Oops'); expect(callRecorder).toHaveBeenCalledTimes(1 + 3); - expect(Date.now() - start).toBeLessThanOrEqual(3 * 5); + expect(Date.now() - start).toBeLessThanOrEqual(25); // Adding a bit buffer due to time measurement in JS }); }); });