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

Add rule 'no-promise-as-boolean' #4790

Merged
merged 14 commits into from
Jul 29, 2019
Merged

Add rule 'no-promise-as-boolean' #4790

merged 14 commits into from
Jul 29, 2019

Conversation

guidsdo
Copy link
Contributor

@guidsdo guidsdo commented Jul 10, 2019

This commit fixes #3983

PR checklist

Overview of change:

Added rule to prevent people from using a Promise in a boolean expression.

Is there anything you'd like reviewers to focus on?

No.

CHANGELOG.md entry:

"[new-rule] no-promise-as-boolean"

@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint, @guidsdo! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@guidsdo
Copy link
Contributor Author

guidsdo commented Jul 10, 2019

Build is failing due to a bug in typescript@next, please ignore this.

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.

Good start!

test/rules/no-promise-as-boolean/test.ts.lint Outdated Show resolved Hide resolved
src/rules/noPromiseAsBooleanRule.ts Outdated Show resolved Hide resolved
src/rules/noPromiseAsBooleanRule.ts Outdated Show resolved Hide resolved
src/rules/noPromiseAsBooleanRule.ts Show resolved Hide resolved
src/rules/noPromiseAsBooleanRule.ts Outdated Show resolved Hide resolved
src/rules/noPromiseAsBooleanRule.ts Outdated Show resolved Hide resolved
@guidsdo
Copy link
Contributor Author

guidsdo commented Jul 17, 2019

@JoshuaKGoldberg fixed all the issues, please re-review

@guidsdo
Copy link
Contributor Author

guidsdo commented Jul 24, 2019

@JoshuaKGoldberg can I expect you to look at this before the 1st of August?

@nomcopter
Copy link
Contributor

Would love to use this in tslint before it is too late!

@guidsdo
Copy link
Contributor Author

guidsdo commented Jul 26, 2019

Would love to use this in tslint before it is too late!

The end is near

@JoshuaKGoldberg
Copy link
Contributor

Hi folks! The 1st of August deadline is for sending PRs. I'm a bit swamped now but promise to review this, even if it's after then! 💖

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.

Wonderful, thanks so much for adding this @guidsdo!

src/rules/noPromiseAsBooleanRule.ts Outdated Show resolved Hide resolved
@JoshuaKGoldberg
Copy link
Contributor

Ah, I don't have permissions to make the one suggested change @guidsdo. Could you please commit that suggestion and merge the latest master into this PR? Once you do, we'll be good to merge! 🚀

@guidsdo
Copy link
Contributor Author

guidsdo commented Jul 29, 2019

Ah, I don't have permissions to make the one suggested change @guidsdo. Could you please commit that suggestion and merge the latest master into this PR? Once you do, we'll be good to merge! 🚀

Thought I put that on, but thanks I applied the change and merged master into my branch :-)

@JoshuaKGoldberg
Copy link
Contributor

giphy

Thanks so much @guidsdo! Rule is looking great; let's get it in.

@JoshuaKGoldberg JoshuaKGoldberg merged commit a3a0b32 into palantir:master Jul 29, 2019
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.

[Rule Request] no-misused-promises
4 participants