-
Notifications
You must be signed in to change notification settings - Fork 889
Fix [ban]: wrong logic matching deeply nested methods #4383
Conversation
Thanks for your interest in palantir/tslint, @zhouhaoyu! 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. |
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.
LGTM, thanks @zhouhaoyu!
Note: this would be a breaking change, as some users may be accidentally relying on the old (technically incorrect) behavior. This PR will have to wait until TSLint is ready to merge in PRs for a next major version. Generally it'd be better to have an issue filed before a PR for changes, but this seems small enough to discuss here. Great catch @zhouhaoyu! |
Any idea when this will be released? |
/cc @adidahiya |
We usually treat fixes to rule behavior like this as non-breaking, even though users might be relying on the old faulty behavior. I just want to confirm that the false positive existed before this change and then I'll merge 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.
updated the changelog entry to be more precise, let me know if that looks ok
PR checklist
Overview of change:
Fix a bug where
a.b.c()
may also match witha.c()
.Is there anything you'd like reviewers to focus on?
CHANGELOG.md entry:
[bugfix]
ban
: Fix a false positive which would occur when banning method calls nested inside objects. Previously, banning["a", "b", "c"]
would trigger lint failures on the syntaxb.c()
, which was not the intent of this rule.