Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [no-useless-constructor] handle bodyless constructor #685

Merged
merged 3 commits into from Jul 25, 2019

Conversation

bradzacher
Copy link
Member

I don't know how nobody has run into this yet!

@bradzacher bradzacher added the bug Something isn't working label Jul 9, 2019
Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the typescript compiler itself would error on this particular test case you have added (“Constructor implementation is missing”) so that will be why it doesn’t come to us as a linting concern I imagine?

@bradzacher
Copy link
Member Author

It would error for this case in a standard file, but in a .d.ts this is valid!

Also this is valid with a proper constructor def as an overload:

class foo {
    constructor();
    constructor(str?: string) {
        
    }
}

@JamesHenry JamesHenry merged commit 55e788c into master Jul 25, 2019
@JamesHenry JamesHenry deleted the fix-no-useless-constructor branch July 25, 2019 00:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants