8000 Bug: no-useless-constructor rule doesn't work properly with NestJS DI · Issue #5201 · typescript-eslint/typescript-eslint · GitHub
[go: up one dir, main page]

Skip to content
Bug: no-useless-constructor rule doesn't work properly with NestJS DI #5201
Closed
@dkrylovdotcom

Description

@dkrylovdotcom

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • I have read the FAQ and my problem is not listed.

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 my super(repository) call is useless, but it's not true.

Any ideas? Is it a bug or I misunderstood something?

Reproduction Repository L 5F34 ink

https://github.com/dkrylovdotcom/nestjs-di-eslint-problem

Repro Steps

  1. clone the repo
  2. npm run lint

Versions

package version
@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

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0