Type inference for Context.Tag

Hello, after a while I am coming back to effect and am struggling with a simple thing I cant get my head around. I want to define a service like:
export class ThingsboardService extends Context.Tag('ThingsBoard')<
  ThingsboardService,
  ThingsboardClient
>() {
  public static live = Layer.succeed(ThingsboardService, clientImpl())
}

The service and the implementation work just fine, but I am trying to get my head around the types.

I have the linter rule https://typescript-eslint.io/rules/no-unsafe-call/ activated for my project and it throws up at Context.Tag('ThingsBoard') ... with "Unsafe call of an any typed value". On the usage side I have ``` const program = Effect.gen(function* () { const tb = yield* TB.ThingsboardService const result = yield* tb.login yield* Console.log(Logged in: ${result}) }) ``` and the 2nd line shows "Unsafe assignment of an anytyped value." -- Even though the type of tb is inferred correctly to ThingsboardClient`.

I could deactivate the rule of course, but I wondering if I am missing a crucial part here.
Was this page helpful?