Skip to content
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

Disable @typescript-eslint/no-this-alias rule #104

Closed
achingbrain opened this issue Jun 16, 2022 · 0 comments · Fixed by #105
Closed

Disable @typescript-eslint/no-this-alias rule #104

achingbrain opened this issue Jun 16, 2022 · 0 comments · Fixed by #105

Comments

@achingbrain
Copy link
Member

achingbrain commented Jun 16, 2022

This rule stops you from doing things like:

const self = this

function foo () {
  return self.derp()
}

It prefers:

const foo = () => {
  return this.derp()
}

Which is fine. The problem is fat-arrows can't be generator functions and we use them all over the place so you have to use this aliases:

const self = this

function * foo () {
  yield self.derp()
}
achingbrain added a commit that referenced this issue Jun 16, 2022
Allow aliasing self for use within (async) generator functions.

Fixes: #104
achingbrain added a commit that referenced this issue Jun 17, 2022
Allow aliasing self for use within (async) generator functions.

Fixes: #104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant