Add @typescript-eslint/no-base-to-string (#10091)

This commit is contained in:
Michael Telatynski
2023-02-07 10:08:10 +00:00
committed by GitHub
parent 30cc55515e
commit 35d222bac6
10 changed files with 28 additions and 14 deletions

View File

@@ -19,7 +19,7 @@ import { logger } from "matrix-js-sdk/src/logger";
import { IDestroyable } from "./IDestroyable";
import { arrayFastClone } from "./arrays";
export type WhenFn<T> = (w: Whenable<T>) => void;
export type WhenFn<T extends string | number> = (w: Whenable<T>) => void;
/**
* Whenables are a cheap way to have Observable patterns mixed with typical
@@ -27,7 +27,7 @@ export type WhenFn<T> = (w: Whenable<T>) => void;
* are intended to be used when a condition will be met multiple times and
* the consumer needs to know *when* that happens.
*/
export abstract class Whenable<T> implements IDestroyable {
export abstract class Whenable<T extends string | number> implements IDestroyable {
private listeners: { condition: T | null; fn: WhenFn<T> }[] = [];
/**