generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Properly check directly exported renderer
There was a gap with the detection of Control renderers that are declared in a separate module and directly returned within the module without using a locale variable. This issue was only reproducible within the context of UI5 framework libraries where type definitions via @sapui5/types are available in addition to the actual source code. For that reason a specific test case within the sap.f test project has been added.
- Loading branch information
Showing
5 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
test/fixtures/linter/projects/sap.f/src/sap/f/ProductSwitch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sap.ui.define([ | ||
"sap/ui/core/Control", | ||
|
||
// NOTE: For this test case it is important to use the full namespace, not a relative import here. | ||
// It makes a difference on how TypeScript resolves types and how SourceFileLinter analyses the renderer declaration | ||
"sap/f/ProductSwitchRenderer" | ||
], function (Control, ProductSwitchRenderer) { | ||
"use strict"; | ||
var ProductSwitch = Control.extend("sap.f.ProductSwitch", { | ||
renderer: ProductSwitchRenderer | ||
}); | ||
return ProductSwitch; | ||
}); |
10 changes: 10 additions & 0 deletions
10
test/fixtures/linter/projects/sap.f/src/sap/f/ProductSwitchRenderer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sap.ui.define(function () { | ||
"use strict"; | ||
return { | ||
apiVersion: 1, // Reported: apiVersion property must be present and to have value 2 | ||
render: function (oRm, oControl) { | ||
// Reported: IconPool is NOT declared as dependency | ||
oRm.icon("sap-icon://appointment", null, { title: null }); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.