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

only-arrow-functions: Allow functions that use 'this' somewhere in the body #2229

Merged
merged 1 commit into from Mar 6, 2017
Merged

Conversation

ghost
Copy link

@ghost ghost commented Feb 22, 2017

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

What changes did you make?

Changed only-arrow-functions to allow a non-arrow function if this appears somewhere in its body. These cannot be converted to arrow functions.
There is already an exception for this as an explicit parameter, but often it comes from a contextual type, as in:

function f(g: (this: number) => void) { g.call(0); }
f(function() { console.log(this) });

[enhancement] only-arrow-functions allow functions that use this in the body

Copy link
Contributor

@nchen63 nchen63 left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

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

Successfully merging this pull request may close these issues.

2 participants