Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Consider ManagedObject as base class for bind* & applySettings #513

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/linter/ui5Types/SourceFileLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -842,15 +842,15 @@ export default class SourceFileLinter {
this.#reportTestStarter(node);
} else if (symbolName === "applySettings" &&
nodeType.symbol?.declarations?.some((declaration) =>
this.isUi5ClassDeclaration(declaration, "sap/ui/core/Control"))) {
this.isUi5ClassDeclaration(declaration, "sap/ui/base/ManagedObject"))) {
matz3 marked this conversation as resolved.
Show resolved Hide resolved
this.#analyzeNewAndApplySettings(node);
} else if (["bindProperty", "bindAggregation"].includes(symbolName) &&
moduleName === "sap/ui/base/ManagedObject" &&
node.arguments[1] && ts.isObjectLiteralExpression(node.arguments[1])) {
this.#analyzePropertyBindings(node.arguments[1], ["type", "formatter"]);
} else if (symbolName.startsWith("bind") &&
nodeType.symbol?.declarations?.some((declaration) =>
this.isUi5ClassDeclaration(declaration, "sap/ui/core/Control")) &&
this.isUi5ClassDeclaration(declaration, "sap/ui/base/ManagedObject")) &&
node.arguments[0] && ts.isObjectLiteralExpression(node.arguments[0])) {
// Setting names in UI5 are case sensitive. So, we're not sure of the exact name of the property.
// Check decapitalized version of the property name as well.
Expand Down