Skip to content
This repository was archived by the owner on Oct 19, 2021. It is now read-only.
This repository was 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

@nickperkinslondon

Description

@nickperkinslondon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions