Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Bump typescript-eslint from 7.16.1 to 8.0.0 #104

Merged
merged 3 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/execution/retry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
});
});
Expand Down
7 changes: 4 additions & 3 deletions lib/cache/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { InMemoryCache } from './memory.js';
import { isCacheKey, isPromiseLike } from '../util/predicates.js';

type CacheDecorator = <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand Down Expand Up @@ -51,7 +51,7 @@ export const CACHE_KEY = Symbol.for('Cache_Key');
*/
export function CacheKey(position: number): CacheDecorator {
return <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
_ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down Expand Up @@ -97,7 +97,7 @@ export function CacheKey(position: number): CacheDecorator {
*/
export function Cache(config?: CacheConfig): CacheDecorator {
return <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
_ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/execution/debounce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { UnitOfTime } from '../util/types.js';
import { convertFrom } from '../util/transfomers.js';

type DebounceDecorator = <TThis, TArgs extends unknown[], Return extends void>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand All @@ -29,7 +29,7 @@ type DebounceDecorator = <TThis, TArgs extends unknown[], Return extends void>(
*/
export function Debounce(time: number, unit: Exclude<UnitOfTime, 'Nanosecond'>): DebounceDecorator {
return <TThis, TArgs extends unknown[], Return extends void>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/execution/once.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type OnceDecorator = <TThis, TArgs extends unknown[], Return extends void>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand All @@ -25,7 +25,7 @@ type OnceDecorator = <TThis, TArgs extends unknown[], Return extends void>(
*/
export function Once(force: boolean = false): OnceDecorator {
return <TThis, TArgs extends unknown[], Return extends void>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down
7 changes: 4 additions & 3 deletions lib/execution/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { convertFrom } from '../util/transfomers.js';
import { UnitOfTime } from '../util/types.js';

type RetryDecorator = <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand Down Expand Up @@ -98,11 +98,11 @@ export function Retry(isRetrieable: (error: Error) => boolean, config: Partial<R
const delayInMs = convertFrom(delay, UnitOfTime.Millisecond, unit as UnitOfTime);

return <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
_ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => 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++) {
Expand Down Expand Up @@ -149,6 +149,7 @@ export function Retry(isRetrieable: (error: Error) => boolean, config: Partial<R
.catch((_error) =>
handleAsyncRetries()
.then((response) => resolve(response))
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
.catch((error) => reject(error)),
);
}) as Return;
Expand Down
4 changes: 2 additions & 2 deletions lib/execution/throttle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { UnitOfTime } from '../util/types.js';
import { convertFrom } from '../util/transfomers.js';

type ThrottleDecorator = <TThis, TArgs extends unknown[], Return extends void>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand Down Expand Up @@ -30,7 +30,7 @@ type ThrottleDecorator = <TThis, TArgs extends unknown[], Return extends void>(
*/
export function Throttle(time: number, unit: Exclude<UnitOfTime, 'Nanosecond'>): ThrottleDecorator {
return <TThis, TArgs extends unknown[], Return extends void>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down
6 changes: 3 additions & 3 deletions lib/metrics/counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Kind } from '../util/types.js';
import { MetricBroadcaster } from './broadcaster.js';

type CounterDecorator = <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand All @@ -29,7 +29,7 @@ type CounterDecorator = <TThis, TArgs extends unknown[], Return>(
*/
export function CallCounter(label: string): CounterDecorator {
return <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
_ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down Expand Up @@ -63,7 +63,7 @@ export function CallCounter(label: string): CounterDecorator {
*/
export function Counter(label: string): CounterDecorator {
return <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
_ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/metrics/gauge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Kind } from '../util/types.js';
import { MetricBroadcaster } from './broadcaster.js';

type GaugeDecorator = <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand All @@ -29,7 +29,7 @@ type GaugeDecorator = <TThis, TArgs extends unknown[], Return>(
*/
export function Gauge(label: string): GaugeDecorator {
return <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
_ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/metrics/measure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isBigint, isHrTimeAvailable, isPromiseLike } from '../util/predicates.j
import { convertRecordedTime } from '../util/transfomers.js';

type MeasureDecorator = <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => void;
Expand All @@ -31,7 +31,7 @@ type MeasureDecorator = <TThis, TArgs extends unknown[], Return>(
*/
export function Measure(label: string, unit: UnitOfTime): MeasureDecorator {
return <TThis, TArgs extends unknown[], Return>(
// eslint-disable-next-line @typescript-eslint/ban-types
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
target: Function,
_ctx: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => Return>,
) => {
Expand Down
Loading
Loading