Add no-unnecessary-qualifier
rule
#2008
Add no-unnecessary-qualifier
rule
#2008
Conversation
b044d1a
to
33638ff
Compare
@@ -111,6 +111,10 @@ export class Replacement { | |||
return replacements.reduce((text, r) => r.apply(text), content); | |||
} | |||
|
|||
public static deleteFromTo(start: number, end: number): Replacement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the one in ruleWalker.ts
@andy-hanson @adidahiya how about naming this |
The rule is about notifying you that a certain node in your AST can be removed if it's unnecessary. It doesn't measure the length of anything. |
My concern is that |
In my case, I'm just trying to eliminate single qualifiers -- I can see how Will think about this later. |
This should work for enum too. At least the name implies that. Don't know if it does already, but there is no test for it. enum Foo {
Bar,
Baz = Foo.Bar // could be written as Baz = Bar
} |
@andy-hanson thanks! name is ok |
PR checklist
What changes did you make?
Added the
no-unnecessary-qualifier
rule, which warns forA.x
if justx
would have the same meaning.