简体   繁体   中英

NestJS 'type' is declared but its value is never read.ts(6133)

This is my code and 'type' is underlined in red and show me this error:

'type' is declared but its value is never read.ts(6133)

My code:

@ManyToMany(type => RoleEntity, role => role.users, {eager: true})

Any solutions?

Like Noah said, you can use a discard name like _ or you can use a blank function. The two approaches would look like so:

@ManyToMany(_ => RoleEntity, role => role.users, {eager: true})

OR

@ManyToMany(() => RoleEntity, role => role.users, {eager: true})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM