feat: Don't enforce a renderer for subclasses of HTMLElement - #1126
feat: Don't enforce a renderer for subclasses of HTMLElement#1126codeworrior wants to merge 1 commit into
Conversation
UI5 runtime introduces a new base class for native HTML controls and webcomponents. This base class implements renderer inheritance. A missing renderer property in a subclass therefore should not be reported as an error.
1273cb3 to
f6f5a0c
Compare
|
Locally for me, the tests seem to pass with and without the change in |
I had a discussion about this with @matz3 via private chat. The reasons IMO is that sap/ui/core/html/HTMLElement doesn't exist yet, esp. not in the @sapui5/types 1.136. Therefore, TypeScript / the linter can't know that HTMLElement is a control and should be checked for a proper renderer declaration. And as the test is a negative test, the lack of a finding does not cause a failure. I've tested the current linter (w/o the PR) against @Thodd's change (openui5 6222857). I see no errors, neither for the new library When I copy everything together in one project so that TypeScript sees base class and subclass at the same time, then I get the expected errors for al the subclasses: /xxxxx/openui5/src/sap.ui.core/src/sap/html/Strong.js
9:20 error Control 'Strong' is missing a renderer declaration no-deprecated-control-renderer-declaration |
|
Update: with the PR, I don't see the errors. |
UI5 runtime introduces a new base class for native HTML controls and webcomponents. This base class implements renderer inheritance. A missing renderer property in a subclass therefore should not be reported as an error.