Skip to content

Commit

Permalink
test(eslint-plugin): additional cases for generic params
Browse files Browse the repository at this point in the history
  • Loading branch information
Retsam committed Sep 6, 2019
1 parent 36d5f5c commit 5df4788
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -119,6 +119,20 @@ function test<T extends object>(t: T) {
}`,
errors: [ruleError(3, 10, 'alwaysTruthy')],
},
{
code: `
function test<T extends false>(t: T) {
return t ? 'yes' : 'no'
}`,
errors: [ruleError(3, 10, 'alwaysFalsy')],
},
{
code: `
function test<T extends 'a' | 'b'>(t: T) {
return t ? 'yes' : 'no'
}`,
errors: [ruleError(3, 10, 'alwaysTruthy')],
},

// Still errors on in the expected locations when ignoring RHS
{
Expand Down

0 comments on commit 5df4788

Please sign in to comment.