Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ficristo opened this issue Feb 4, 2019 · 0 comments · Fixed by #237
Closed

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

ficristo opened this issue Feb 4, 2019 · 0 comments · Fixed by #237
Labels
bug Something isn't working external This issue is with another package, not typescript-eslint itself package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@ficristo
Copy link

ficristo commented Feb 4, 2019

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
@ficristo ficristo added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Feb 4, 2019
@j-f1 j-f1 added bug Something isn't working external This issue is with another package, not typescript-eslint itself and removed triage Waiting for team members to take a look labels Feb 5, 2019
kaicataldo pushed a commit to kaicataldo/typescript-eslint that referenced this issue Aug 27, 2019
https://yarnpkg.com/lang/en/docs/cli/check/#toc-yarn-check-verify-tree

`yarn check` will ensure that your dependencies are up-to-date before committing.

This ensures that when you raise a PR, travis will not fail due to an error introduced in a new version of a tool.
@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Feb 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working external This issue is with another package, not typescript-eslint itself package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants