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

Condition-checking rules should check array callbacks #1038

Open
ark120202 opened this issue Oct 2, 2019 · 3 comments
Open

Condition-checking rules should check array callbacks #1038

ark120202 opened this issue Oct 2, 2019 · 3 comments
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@ark120202
Copy link

To make iteration methods be more similar to regular conditions their return types were changed to unknown (see microsoft/TypeScript#7779 and microsoft/TypeScript#31076). Rules that check conditions (strict-boolean-expressions, no-unnecessary-condition and no-misused-promises) can be quite useful to make make it safer

@ark120202 ark120202 added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Oct 2, 2019
@bradzacher bradzacher added enhancement: plugin rule option New rule option for an existing eslint-plugin rule and removed triage Waiting for maintainers to take a look labels Oct 3, 2019
@bradzacher bradzacher added the has pr there is a PR raised to close this label Nov 14, 2019
@bradzacher bradzacher removed the has pr there is a PR raised to close this label Sep 3, 2020
@tadhgmister
Copy link
Contributor

@ark120202 because the pull request didn't have the "Fixes" directive this wasn't automatically closed, would you mind closing it for house keeping purposes?

@ark120202
Copy link
Author

It doesn't sound like it was completely resolved. Only no-unnecessary-condition appears to check it, but there are also strict-boolean-expressions and no-misused-promises (and maybe more rules I could've been missed)

@tadhgmister
Copy link
Contributor

tadhgmister commented Sep 15, 2020

right sorry, was focused on the pull request I see now you mention those rules in your initial comment. I have already advocated for this in strict-boolean-expression.

Not sure if this feels right to put in no-misused-promises since it seems pretty specific and already checked via no-unnecessary-condition, like passing a promise to console.log isn't labeled as a problem and there isn't much we can do to check all cases where it is misuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

4 participants