Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[new-rule] Added new invalid-void rule #4736

Merged
merged 15 commits into from Jul 6, 2019

Conversation

timocov
Copy link
Contributor

@timocov timocov commented May 21, 2019

PR checklist

Overview of change:

Added new rule no-invalid-void which fails on every "invalid" usage of the void type.

CHANGELOG.md entry:

[new-rule] no-invalid-void

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Implementation generally looks good: some comments around semantics please!

src/rules/noInvalidVoidRule.ts Outdated Show resolved Hide resolved
src/rules/noInvalidVoidRule.ts Outdated Show resolved Hide resolved
src/rules/noInvalidVoidRule.ts Outdated Show resolved Hide resolved
src/rules/noInvalidVoidRule.ts Outdated Show resolved Hide resolved
src/rules/noInvalidVoidRule.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looking good so far - mostly just interested in expanding the test coverage, since there are a lot of potential edge cases.

test/rules/invalid-void/test.ts.lint Outdated Show resolved Hide resolved
test/rules/invalid-void/test.ts.lint Outdated Show resolved Hide resolved
src/rules/invalidVoidRule.ts Outdated Show resolved Hide resolved
src/rules/invalidVoidRule.ts Outdated Show resolved Hide resolved
@timocov timocov changed the title [new-rule] Added new no-invalid-void rule [new-rule] Added new invalid-void rule Jun 16, 2019
@timocov
Copy link
Contributor Author

timocov commented Jul 1, 2019

@JoshuaKGoldberg can you please take a look? Do I need to do fix something else?

@JoshuaKGoldberg
Copy link
Contributor

Planning on looking at pending PRs this week!

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Almost there 🙏 I promise!

src/language/rule/abstractRule.ts Show resolved Hide resolved
@timocov
Copy link
Contributor Author

timocov commented Jul 6, 2019

There is CI error, but it looks like the master is failed too.

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks great to me. Thanks so much for sticking through the PR reviews @timocov! 🚀

@JoshuaKGoldberg JoshuaKGoldberg merged commit aa2af99 into palantir:master Jul 6, 2019
@timocov timocov deleted the no-invalid-void-rule branch July 6, 2019 14:37
@timocov
Copy link
Contributor Author

timocov commented Jul 6, 2019

🕺 thank you @JoshuaKGoldberg

@buu700
Copy link
Contributor

buu700 commented Sep 7, 2019

@timocov, is it expected that this complains about types like Promise<void>, and if so is Promise<undefined> the recommended style?

@timocov
Copy link
Contributor Author

timocov commented Sep 8, 2019

Hey @buu700, I don't think that it was intended and I don't think that Promise<undefined> is what I suggest to use instead either. For me, we should add exception for Promise<void> case (and PromiseLike<void> as well). @JoshuaKGoldberg what do you think?

@adidahiya
Copy link
Contributor

@buu700 @timocov see #4832

@buu700
Copy link
Contributor

buu700 commented Sep 8, 2019

Whoops, sorry about the duplicate report, but thanks for the link!

@JoshuaKGoldberg
Copy link
Contributor

Yup, this was an error on my end for not noticing in review. Updated the fix PR. It should be in soon

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New no-invalid-void rule
4 participants