hello there 👋🏽
We're adopting github/recommended and github/typescript rules. Recently we found that we started getting the following eslint error: no-invalid-this on our typescript projects, the error is valid in javascript however is a false positive in typescript.
repro:
class Foo extends SuperFoo {
constructor() {
super()
this.foo = -1 // eslint error no-invalid-this
}
public setFoo = (foo: number) => {
this.foo = foo // eslint error no-valid-this
}
}
Expected Result
No lint error since this is used as part of the correct lexical scope and class
error(s):
from npm run lint
error Unexpected 'this' no-invalid-this
| package |
version |
| eslint-plugin-github |
^4.2.0 |
| @typescript-eslint/eslint-plugin |
^4.29.3 |
| Typescript |
^4.3.5 |
| ESLint |
^7.32.0 |
| node |
v14.17.1 |