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

Incorrect errors when adding this parameter to functions #1393

@olee

Description

@olee

Bug Report

  • TSLint version: (unknown - tslint used by Atom plugin linter-tslint)
  • TypeScript version: latest
  • Running TSLint via: Atom

TypeScript code being linted

function cloneEntity(this: IEntity) {
    var result = Object.create(Object.getPrototypeOf(this));
    Object.keys(this).filter(key => !key.startsWith('$') && filteredEntityProperties.indexOf(key) < 0).forEach((key) => {
        result[key] = angular.copy(this[key]);
    });
    return result;
}

Actual behavior

The following errors are show (in Atom)

no-unused-expression - expected an assignment or function callat line 22 col 22
no-unused-expression - expected an assignment or function callat line 22 col 28
semicolon - missing semicolonat line 22 col 26
semicolon - missing semicolonat line 22 col 35

Expected behavior

No error shown

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions