Skip to content

disable base no-invalid-this rule in favor of @typescript-eslint/no-invalid-this #135

@stephenotalora

Description

@stephenotalora

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions