Skip to content

Commit

Permalink
refactor: Provide details for data-sap-ui-areas
Browse files Browse the repository at this point in the history
  • Loading branch information
d3xter666 committed Dec 11, 2024
1 parent 3344c0b commit f22175f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/linter/html/transpiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,17 @@ function lintBootstrapAttributes(tag: Tag, report: HtmlReporter) {
}, attr.name);
break;
case "data-sap-ui-xx-no-less":
case "data-sap-ui-areas":
case "data-sap-ui-trace":
report.addMessage(MESSAGE.ABANDONED_BOOTSTRAP_PARAM, {
name: attr.name.value,
}, attr.name);
break;
case "data-sap-ui-areas":
report.addMessage(MESSAGE.ABANDONED_BOOTSTRAP_PARAM, {
name: attr.name.value,
messageDetails: "No longer supported. UI areas are created on request by calling Control.placeAt",
}, attr.name);
break;
case "data-sap-ui-animation":
report.addMessage(MESSAGE.REPLACED_BOOTSTRAP_PARAM, {
name: attr.name.value,
Expand Down
2 changes: 1 addition & 1 deletion src/linter/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const MESSAGE_INFO = {

message: ({name}: {name: string}) =>
`Abandoned bootstrap parameter '${name}' should be removed`,
details: () => undefined,
details: ({messageDetails}: {messageDetails?: string}) => messageDetails,
},

[MESSAGE.ABANDONED_BOOTSTRAP_PARAM_ERROR]: {
Expand Down
1 change: 1 addition & 0 deletions test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Generated by [AVA](https://avajs.dev).
column: 3,
line: 17,
message: 'Abandoned bootstrap parameter \'data-sap-ui-areas\' should be removed',
messageDetails: 'No longer supported. UI areas are created on request by calling Control.placeAt',
ruleId: 'no-deprecated-api',
severity: 1,
},
Expand Down
Binary file modified test/lib/linter/rules/snapshots/NoDeprecatedApi.ts.snap
Binary file not shown.

0 comments on commit f22175f

Please sign in to comment.