-
Notifications
You must be signed in to change notification settings - Fork 886
Rule suggestion: static-this #4428
Comments
Hey, |
@mbelsky there's no way to assign someone who's not in the Palantir org unfortunately. Posting here should be enough indicator to ask others not to tackle it soon, hopefully! Re
|
This improperly flags
|
Hey, |
@JoshuaKGoldberg could you please create a new issue for this false positive case and assign to me? |
I opened a new issue: #4579 I also noticed above that Joshua indicated that he could not assign something to you: |
Oh yes, this issue was resolved by the original PR, and #4579 tracks the followup false positive case. Thanks folks! |
Rule Suggestion
Is your rule for a general problem or is it specific to your development style?
General problem
What does your suggested rule do?
Ban the use of
this
in static methods.Static
this
usage can be confusing for newcomers.It can also become imprecise when used with extended classes when a static
this
of a parent class no longer specifically refers to the parent class.List several examples where your rule could be used
Instead of:
Prefer:
See https://github.com/ajafff/tslint-consistent-codestyle/blob/master/docs/no-static-this.md
Additional context
Spinning off of #2040: moving some rules of tslint-consistent-codestyle to tslint core.
Note that as ajafff mentioned, copied code without substantial changes needs to retain the original license.
The text was updated successfully, but these errors were encountered: