lyne-components icon indicating copy to clipboard operation
lyne-components copied to clipboard

Refactor the 'missing-component-documentation-rule' in order to resolve the super.calls in events const

Open DavideMininni-Fincons opened this issue 10 months ago • 0 comments

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?

DavideMininni-Fincons avatar Apr 18 '24 10:04 DavideMininni-Fincons