joist-framework/joist

@joist/di: lint rule for inject array not matching Injected types.

deebloo opened this issue · 0 comments

It would be nice if there was a lint rule that could detect if the array of injected dependencies didn't match the arguments passed to the constructor. This would only work with typescript.

For example:

class Foo {}
class Bar {}

// This should throw an error since Foo != Bar
class Baz {
  static inject = [Foo]; 

  constructor(foo: Injected<Bar>) {}
}