Skip to content

Commit

Permalink
fix: Remove checks for deprecated property names in manifest.json rou…
Browse files Browse the repository at this point in the history
…ting (#356)

Switching to the new format is more complex and requires guide to
migrate.
Currently, there isn't any documentation and thus the check might cause
confusion. Therefore, removing it for now.
  • Loading branch information
maxreichmann authored Oct 9, 2024
1 parent 506b107 commit 631e78a
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 524 deletions.
16 changes: 0 additions & 16 deletions src/linter/manifestJson/ManifestLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ export default class ManifestLinter {
viewType: routing.config.viewType,
}, "/sap.ui5/routing/config/viewType");
}
if (routing?.config) {
this.detectDeprecatedPropertyNames(routing.config, "/sap.ui5/routing/config");
}

// Detect deprecations in routing.targets:
const targets = routing?.targets;
Expand All @@ -119,8 +116,6 @@ export default class ManifestLinter {
viewType: target.viewType,
}, `${pathToViewObject}/viewType`);
}
// Detect deprecated property names:
this.detectDeprecatedPropertyNames(target, pathToViewObject);
}
}

Expand Down Expand Up @@ -165,15 +160,4 @@ export default class ManifestLinter {
}
});
}

detectDeprecatedPropertyNames(viewObject: Record<string, unknown>, pathToViewObject: string) {
// Detect every property name starting with "view" except "viewType":
for (const key of Object.keys(viewObject)) {
if (key.startsWith("view") && key !== "viewType") {
this.#reporter?.addMessage(MESSAGE.DEPRECATED_VIEW_CONFIG, {
propertyName: key,
}, `${pathToViewObject}/${key}`);
}
}
}
}
11 changes: 0 additions & 11 deletions src/linter/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export enum MESSAGE {
DEPRECATED_PROPERTY,
DEPRECATED_PROPERTY_OF_CLASS,
DEPRECATED_THEME,
DEPRECATED_VIEW_CONFIG,
DEPRECATED_VIEW_TYPE,
DUPLICATE_BOOTSTRAP_PARAM,
HTML_IN_XML,
Expand Down Expand Up @@ -246,16 +245,6 @@ export const MESSAGE_INFO = {
details: () => `{@link topic:a87ca843bcee469f82a9072927a7dcdb Deprecated Themes and Libraries}`,
},

[MESSAGE.DEPRECATED_VIEW_CONFIG]: {
severity: LintMessageSeverity.Error,
ruleId: RULES["no-deprecated-api"],

message: ({propertyName}: {propertyName: string}) =>
`Use of deprecated property '${propertyName}'. ` +
`Use '${propertyName.substring(4).toLowerCase()}' instead'`,
details: () => undefined,
},

[MESSAGE.DEPRECATED_VIEW_TYPE]: {
severity: LintMessageSeverity.Error,
ruleId: RULES["no-deprecated-api"],
Expand Down
Loading

0 comments on commit 631e78a

Please sign in to comment.