KEMBAR78
Fat arrow is necessary when super is called · Issue #214 · clutchski/coffeelint · GitHub
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.

Fat arrow is necessary when super is called #214

@plaxdan

Description

@plaxdan
    run: ->
      When(someFunction()).done =>
        super

The above code triggers the 'unnecessary fat arrow' linter. However without the fat arrow, this within the super run will refer to window instead of the superclass.

The suggestion is that the linter checks for the presence of super in the fat arrow function and if it's present, then the linter passes. If no reference is found to either this or super then the fat arrow is indeed unnecessary.

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