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

This commit is contained in:
Alejandro Celaya
2021-02-28 18:48:36 +01:00
parent ad0a889548
commit ce0fc1094e
9 changed files with 14 additions and 13 deletions

View File

@@ -20,8 +20,8 @@ type LazyActionMap = Record<string, Function>;
const bottle = new Bottle();
const { container } = bottle;
const lazyService = <T extends Function>(container: IContainer, serviceName: string) =>
(...args: any[]) => (container[serviceName] as T)(...args);
const lazyService = <T extends Function, K>(container: IContainer, serviceName: string) =>
(...args: any[]) => (container[serviceName] as T)(...args) as K;
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