Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[no-shadow] error on this used as parameter function #207

Copy link
Copy link
Closed
@ficristo

Description

@ficristo
Issue body actions

Repro

{
  "rules": {
    "no-shadow": "error"
  }
}
class NodeDomain {
    private _load() {
        const connection = this.connection;
        return connection.loadDomains(this._domainPath, true)
            .done(function (this: NodeDomain) {
                this._domainLoaded = true;
                this._connectionPromise = null;

                const eventNames = Object.keys(connection.domainEvents[this._domainName]);
                eventNames.forEach(function (this: NodeDomain, domainEvent) {
                    const connectionEvent = this._domainName + ":" + domainEvent + EVENT_NAMESPACE;

                    (connection as unknown as EventDispatcher.DispatcherEvents).on(connectionEvent, function (this: NodeDomain) {
                        const params = Array.prototype.slice.call(arguments, 1);
                        EventDispatcher.triggerWithArray(this, domainEvent, params);
                    }.bind(this));
                }, this);
            }.bind(this))
            .fail(function (this: NodeDomain, err) {
                console.error("[NodeDomain] Error loading domain \"" + this._domainName + "\": " + err);
            }.bind(this));
    }
}

Expected Result
No error

Actual Result
Error on the second and thid this: NodeDomain

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 1.1.0
@typescript-eslint/parser 1.1.0
TypeScript 3.2.4
ESLint 5.13.0
node 10.15.0
npm 6.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingSomething isn't workingexternalThis issue is with another package, not typescript-eslint itselfThis issue is with another package, not typescript-eslint itselfpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.