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

"allow-named-functions" option for "only-arrow-functions" rule #1509

Closed
adidahiya opened this issue Aug 23, 2016 · 2 comments · Fixed by #1857
Closed

"allow-named-functions" option for "only-arrow-functions" rule #1509

adidahiya opened this issue Aug 23, 2016 · 2 comments · Fixed by #1857

Comments

@adidahiya
Copy link
Contributor

I'd like to allow syntax like this with the only-arrow-functions rule:

xmlhttp.onreadystatechange = function handleReadyStateChange() { ... };

In this case I made an intentional decision to name the function and I want to use the function syntax.

@glen-84
Copy link
Contributor

glen-84 commented Aug 24, 2016

Might want to keep this in mind.

handleReadyStateChange can't be called directly after that, can it?

@adidahiya
Copy link
Contributor Author

yep, that's true, it can't be referenced directly anywhere else. I think the only benefit here is better stack traces. also I prefer this syntax for opting out of the tslint rule instead of the more verbose:

function handleReadyStateChange() {
    ...
}

xmlhttp.onreadystatechange = handleReadyStateChange;

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

Successfully merging a pull request may close this issue.

2 participants