nartc/nest-mean

[TS Lint Error] Array type using "T[]" is forbidden?

emjimadhu opened this issue · 3 comments

I am trying to create the base service. But i get tslint error. this is the method

async findAll(
    filter = {},
    selectFields: {}
  ): Promise<InstanceType<T>[]> {
    if (selectFields) {
      return this.model.find(filter).select(selectFields).exec();
    } else {
      return this.model.find(filter).exec();
    }
  }
nartc commented

I think that's a new TSLint rule for complex type or something. Can you try: Array<InstanceType<T>>?

After this i am getting two errors.

The first error is on InstanceType of T

Screenshot 2019-07-30 at 2

nartc commented

@emjimadhu Can you share your whole base.service.ts ?