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

Erroneous Fat Arrow Warning when fn is attached to an object #637

Open
nickperkinslondon opened this issue Apr 16, 2018 · 0 comments
Open

Comments

@nickperkinslondon
Copy link

nickperkinslondon commented Apr 16, 2018

Thank-you so much for Coffee-Lint, I love it!
Just one small request...

The following code gives the "Fat Arrow" warning for "do_it_twice", but this is incorrect.
The function is already bound to the right object.
In fact, the fat arrow cannot be used here at all -- it will break the code!
The linter should detect that a function is being assigned to an object attribute and not suggest using the fat arrow.


do_it = -> console.log "doing it..."

my_thing = 

	do_it_once:->
		do_it()

	do_it_twice:->
		@do_it_once()
		@do_it_once()

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

No branches or pull requests

1 participant