clutchski/coffeelint

Erroneous Fat Arrow Warning when fn is attached to an object

nickperkinslondon opened this issue · 0 comments

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()