-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Hi, we would like to have an officially supported rule to check for overrides. In a massive code base that is written entirely in TypeScript, small functionalities like these makes a big difference.
There is already a plugin we use (and contribute to) for tslint: https://github.com/hmil/tslint-override
There was a lot of issues surrounding this, but since this project aims to re-design some of the functionality may be it's possible to include support for this as well?
This is the excerpt from the said package README.md: (notice the new lines, we believe it was much prettier)
export class Basic {
public overridePlease(): void { }
public doNotOverride(): void { }
}
export class Child extends Basic {
public doNotOverride(): void { } // ERROR: Method Child#doNotOverride is overriding Basic#doNotOverride. Use the @override JSDoc tag if the override is intended
// Make it explicit that you intend to override this member
/** @override */
public overridePlease(): void { }
// Alternatively, you can use the decorator syntax
@override
public overridePlease(): void { }
// Typos won't bother you anymore
/** @override */ public overidePlease(): void { } // ERROR: Method with @override tag is not overriding anything
}
We would also want to contribute to this project if this proposal is seen acceptable.
mysticatea, dlangerenken, eyedean, astoilkov, asbrum and 10 more
Metadata
Metadata
Assignees
Labels
enhancement: new plugin ruleNew rule request for eslint-pluginNew rule request for eslint-pluginpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin