lyne-components
lyne-components copied to clipboard
Refactor the 'missing-component-documentation-rule' in order to resolve the super.calls in events const
If a base class declares
public static readonly events = {
myEvent: 'myEvent',
}
and the derived class does an override like
public static readonly override events = {
...super.event,
anotherEvent: 'anotherEvent',
}
the 'missing-component-documentation-rule' breaks, because it expects only properties and not a spread operator with super calls.
How to possibly fix it:
in missing-component-documentation-rule.ts, if isComponentClass(node)
is true, the base class name can be found using node.superClass
; however, if mixin composition is used, the base class could be retrieved by recursively looking at node.superClass.arguments
(until is empty?)
how to retrieve the class instance from class name? how to retrieve the events?