Bug: no-useless-constructor rule doesn't work properly with NestJS DI #5201
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement
New feature or request
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Issue Description
Greetings, colleagues!
I faced with a problem of useless constructor with a rule:
@typescript-eslint/no-useless-constructor
But in my case, it's false positive, coz here I use NestJS DI capabilities to pass necessary parameters in the constructor.
Yep, I understood, that is
eslint
thinkings that mysuper(repository)
call is useless, but it's not true.Any ideas? Is it a bug or I misunderstood something?
Reproduction Repository Link
https://github.com/dkrylovdotcom/nestjs-di-eslint-problem
Repro Steps
Versions
@typescript-eslint/eslint-plugin
5.28.0
@typescript-eslint/parser
5.28.0
TypeScript
4.7.3
ESLint
8.17.0
node
16.15.0
The text was updated successfully, but these errors were encountered: