-
Notifications
You must be signed in to change notification settings - Fork 887
Conversation
Thanks for your interest in palantir/tslint, @noamyogev84! 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. |
Good to see you here @JoshuaKGoldberg . 😄 |
@JoshuaKGoldberg,
|
☹ that's unfortunate @noamyogev84. For now, you can always delete those tests locally and/or only run If that doesn't work for you, ping me on Gitter? |
add unit tests
limit rule to validate only relational/logical expressions, add tests
Hi @JoshuaKGoldberg, sorry for the long wait. 🙏 As you see, the error with |
H @JoshuaKGoldberg. Pinging you one more time... 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress! A few things to touch up.
Looking through the CircleCI failures, your rule has some kind of logic problem, because it's flagging acceptable binary expressions in TSLint's source as tautologies. |
friendly ping @noamyogev84, do you expect to have time to return to this PR? thanks |
Hi @adidahiya. I'll do some work, this weekend hopefully. 🕵️ |
modified walk to cover additional cases add property access unit tests
Hi @JoshuaKGoldberg , @adidahiya . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the (late-breaking, sorry!) change for more primitive types! Otherwise this is looking great!
add unit tests
I think we're done 😃 |
} | ||
} else if ( | ||
(isBooleanLiteral(node.left) && isBooleanLiteral(node.right)) || | ||
(isNullLiteral(node.left) && isNullLiteral(node.right)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continuing the previous conversation: this doesn't capture numeric literals or undefined
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
numeric and string literals are covered earlier.
what about undefined? what do you mean by covering this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wow, I should review when fully awake. This looks great. I had forgotten undefined
is an identifier.
} | ||
} else if ( | ||
(isBooleanLiteral(node.left) && isBooleanLiteral(node.right)) || | ||
(isNullLiteral(node.left) && isNullLiteral(node.right)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wow, I should review when fully awake. This looks great. I had forgotten undefined
is an identifier.
@noamyogev84 you've persisted superbly through multiple rounds of code review and slightly inaccurate questioning on my part. Thanks so much for the rule! This is going to be great for catching silly mistakes in user code. |
@JoshuaKGoldberg it's my pleasure man! 🥃 |
PR checklist
Overview of change:
Add a basic rule that validates that two equal literals are not being compared.
Is there anything you'd like reviewers to focus on?
CHANGELOG.md entry:
[new-rule]
no-tautology-expression