You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
Here is an idea for a new rule, which requires type information and can be quite complex. TSLint could warn about redundant conditions, which could reveal typos in code. Consider the following code.
if(x>0&&x>0){}
The check for x > 0 is redundant in the above code, and you might have wanted to write y > 0 instead, but wrote x by mistake.
I'm mainly writing this down as I might try implementing this myself in the future.
The text was updated successfully, but these errors were encountered:
The way I see it, there is just about no end to how far you could take this idea, so I'd start with looking for the same expressions for variables and attributes inside one local Boolean expression.
Note: per #4534, this issue will be closed in less than a month if no PR is sent to add the rule. If you really need the rule, custom rules are always an option and can be maintained outside this repo!
Here is an idea for a new rule, which requires type information and can be quite complex. TSLint could warn about redundant conditions, which could reveal typos in code. Consider the following code.
The check for
x > 0
is redundant in the above code, and you might have wanted to writey > 0
instead, but wrotex
by mistake.I'm mainly writing this down as I might try implementing this myself in the future.
The text was updated successfully, but these errors were encountered: