Skip to content

False positive for tslint:explicit-override rule after upgrading to TypeScript 4.3 #3646

@dominic-simplan

Description

@dominic-simplan
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

.eslintrc.js

{
  "rules": {
    "@typescript-eslint/tslint/config": [
            "error",
            {
                lintFile: "./tslint.json",
            },
        ],
  }
}

tslint.json:

{
    "extends": ["tslint-override"],
    "defaultSeverity": "off",
    "rules": {
        "explicit-override": {
            "severity": "error"
        }
    }
}
export interface Base {
  baseMethod?(): void;
}

export class MyClass implements Base {
  /** @override */ public baseMethod(): void {
  }
}

Expected Result

Should not show an ESLint warning/error as override comment is added correctly.

Actual Result
With TypeScript < 4.3, this works correctly and does not show an ESLint warning/error.
With TypeScript = 4.,3.x, this shows the warning/error:

Member is overriding a base member. Use the @OverRide keyword if this override is intended (tslint:explicit-override)eslint@typescript-eslint/tslint/config)

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin-tslint 4.28.3
@typescript-eslint/parser 4.28.3
TypeScript 4.3.5
ESLint 7.31.0
node 14.16.0
tslint 6.1.3
tslint-override 1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalThis issue is with another package, not typescript-eslint itselfpackage: eslint-plugin-tslintIssues related to @typescript-eslint/eslint-plugin-tslint

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions