Scenario: I want to check that a child class method calls a super class method using super keyword if parent class has such a method. Example:
// parent.ts
class Parent {
a {
// super class method
}
}
// child.ts
class Child extends Parent {
a {
// I want to check if parent class has method a
// then the child class should call super.a(). else show a warning
super.a();
}
}
This felt like a use case for writing a custom ESLint rule. I am not able to check if the parent class has a method with name a so far.
Is this possible with ESLint rules? Is custom ESLint rule a good thing to do this or should i use a different approach?