Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add no-unbound-method rule #2089

Merged
merged 3 commits into from Jan 21, 2017

Conversation

andy-hanson
Copy link
Contributor

PR checklist

What changes did you make?

Added the no-unbound-method rule, which forbids the use of x.foo where foo is a method on a class or interface, but allows y => x.foo(y).

};
/* tslint:enable:object-literal-sort-keys */

public static FAILURE_STRING = "'this' may be unbound when a method is used as a property without being invoked.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about `Avoid referencing unbound class methods which may cause unintentional scoping of 'this'"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed "class" from that since it may be on an interface.

@nchen63
Copy link
Contributor

nchen63 commented Jan 21, 2017

nice, thanks!

@nchen63 nchen63 merged commit d349a30 into palantir:master Jan 21, 2017
@andy-hanson andy-hanson deleted the no_use_method_as_function branch January 21, 2017 03:41
@adidahiya
Copy link
Contributor

Nothing like closing a 2 year old feature request 😃

Can we add tests for JSX usage? As per #259 (comment) and palantir/tslint-react#63

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants