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-unnecessary-condition] false positive when array predicate returns unknown #2772

Merged
merged 2 commits into from Nov 17, 2020
Merged

fix(eslint-plugin): [no-unnecessary-condition] false positive when array predicate returns unknown #2772

merged 2 commits into from Nov 17, 2020

Conversation

ArnaudBarre
Copy link
Contributor

Fix: Mark unknown and any as possibly falsy.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @ArnaudBarre!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@codecov
Copy link

codecov bot commented Nov 17, 2020

Codecov Report

Merging #2772 (2a4e958) into master (3333040) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2772   +/-   ##
=======================================
  Coverage   92.80%   92.80%           
=======================================
  Files         300      300           
  Lines        9852     9854    +2     
  Branches     2767     2767           
=======================================
+ Hits         9143     9145    +2     
  Misses        332      332           
  Partials      377      377           
Flag Coverage Δ
unittest 92.80% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...slint-plugin/src/rules/no-unnecessary-condition.ts 97.17% <100.00%> (+0.03%) ⬆️

@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party bug Something isn't working labels Nov 17, 2020
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Nov 17, 2020
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

@bradzacher bradzacher changed the title fix(eslint-plugin): false positive alwaysTruthyFunc for no-unnecessary-condition when predicate returns unknown fix(eslint-plugin): [no-unnecessary-condition] false positive when array predicate returns unknown Nov 17, 2020
@bradzacher bradzacher merged commit 111c244 into typescript-eslint:master Nov 17, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 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