Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

New no-useless-override rule #3423

Closed
manu-st opened this issue Oct 31, 2017 · 2 comments
Closed

New no-useless-override rule #3423

manu-st opened this issue Oct 31, 2017 · 2 comments

Comments

@manu-st
Copy link

manu-st commented Oct 31, 2017

Feature Request

  • TSLint version: 5.8
  • TypeScript version: 2.5.3
  • Running TSLint via: CLI / VSCode

TypeScript code being linted

   /* tslint:disable-next-line:prefer-function-over-method */
   foo ()
   {
      return this;
   }

with tslint.json configuration:

{
   "rules": {
       "prefer-function-over-method": true
   }
}

Wanted Behavior

It would be great to have a new rule "no-useless-override" which triggers a warning or error when you use an override to disable a rule. Very often you had an override for a special case but through various refactoring this override is not needed anymore and the less override the better has you do not want to add code in the future that won't trigger the linter warning/error because you forgot to remove the useless rule.

Having a rule that checks for non-used override would be great.

Actual behavior

No warnings

Expected behavior

ERROR in C:/Dev/components/data/Navigable.ts
(70,4): Override "prefer-function-over-method" is not needed. Remove the local override.
@ajafff
Copy link
Contributor

ajafff commented Oct 31, 2017

Duplicate of #1330?

@manu-st
Copy link
Author

manu-st commented Oct 31, 2017

That seems to be the case.

@manu-st manu-st closed this as completed Oct 31, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants