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-cond] fix naked type param #1207

Merged
merged 1 commit into from Nov 15, 2019

Conversation

Retsam
Copy link
Contributor

@Retsam Retsam commented Nov 14, 2019

Discovered that conditions involving a naked type param were being incorrectly considered "unnecessary":

function test<T>(t: T) {
  // raised an error here
  return t ? 'yes' : 'no'
}

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @Retsam!

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 14, 2019

Codecov Report

Merging #1207 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1207      +/-   ##
==========================================
+ Coverage   94.14%   94.15%   +<.01%     
==========================================
  Files         124      124              
  Lines        5333     5334       +1     
  Branches     1491     1491              
==========================================
+ Hits         5021     5022       +1     
  Misses        178      178              
  Partials      134      134
Impacted Files Coverage Δ
...slint-plugin/src/rules/no-unnecessary-condition.ts 100% <100%> (ø) ⬆️

@bradzacher bradzacher added the bug Something isn't working label Nov 14, 2019
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 for this

@bradzacher bradzacher changed the title fix(eslint-plugin): [no-unnecessary-condition] fix naked type params fix(eslint-plugin): [no-unnecessary-cond] fix naked type param Nov 15, 2019
@bradzacher bradzacher merged commit 4fac6c5 into typescript-eslint:master Nov 15, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 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