-
Notifications
You must be signed in to change notification settings - Fork 660
feat(rome_js_analyze): noUselessConstructor #4385
Conversation
❌ Deploy Preview for docs-rometools failed.Built without sensitive environment variables
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to take in consideration TypeScript constructor overload. Some frameworks use that feature
In the provided link, the code uses a parameter property to initialize the injected service. |
I was wondering if you could implement a fix for this rule. What do you about a case when we have comments inside the body? |
Cool, would you mind add a test case for that? |
What I suggest:
What do you think? EDIT: I applied my suggestion. Waiting for your input :) |
Done :) |
I like that! |
Summary
This implements no-useless-constructor with two differences:
arguments
.public
modifier. In contrast, TypeScript ESLint does not report empty constructor marked with thepublic
modifier in a class that inherits of another class.Test Plan
ESLint tests included.
Changelog
Documentation