Enabled @typescript-eslint/no-unsafe-call eslint rule again

This commit is contained in:
Alejandro Celaya
2021-02-28 17:43:41 +01:00
parent 86544f4b24
commit 1fe76500e8
7 changed files with 18 additions and 13 deletions

View File

@@ -20,7 +20,8 @@ type LazyActionMap = Record<string, Function>;
const bottle = new Bottle();
const { container } = bottle;
const lazyService = (container: IContainer, serviceName: string) => (...args: any[]) => container[serviceName](...args);
const lazyService = <T extends Function>(container: IContainer, serviceName: string) =>
(...args: any[]) => (container[serviceName] as T)(...args);
const mapActionService = (map: LazyActionMap, actionName: string): LazyActionMap => ({
...map,
// Wrap actual action service in a function so that it is lazily created the first time it is called

View File

@@ -11,7 +11,7 @@ export const bindToMercureTopic = <T>(mercureInfo: MercureInfo, topics: string[]
const onEventSourceMessage = ({ data }: { data: string }) => onMessage(JSON.parse(data) as T);
const onEventSourceError = ({ status }: { status: number }) => status === 401 && onTokenExpired();
const subscriptions: EventSource[] = topics.map((topic) => {
const subscriptions = topics.map((topic) => {
const hubUrl = new URL(mercureHubUrl);
hubUrl.searchParams.append('topic', topic);

View File

@@ -34,7 +34,7 @@ export const useToggle = (initialValue = false): ToggleResult => {
export const useSwipeable = (showSidebar: () => void, hideSidebar: () => void) => {
const swipeMenuIfNoModalExists = (callback: () => void) => (e: any) => {
const swippedOnVisitsTable = (e.event.composedPath() as HTMLElement[]).some( // eslint-disable-lin @typescript-eslint/no-unsafe-call
const swippedOnVisitsTable = (e.event.composedPath() as HTMLElement[]).some( // eslint-disable-line @typescript-eslint/no-unsafe-call
({ classList }) => classList?.contains('visits-table'),
);